Bug 1570499 - Part 3: Remove MOZ_FALLTHROUGH macro definition. r=froydnj
authorChris Peterson <cpeterson@mozilla.com>
Fri, 20 Dec 2019 07:03:27 +0000
changeset 507985 221bb3c0cea1c6eecebc0c858c438c32c9d50ad3
parent 507984 1802196cadec4a90f4aa21f9ac2fed0ab2bbed58
child 507986 feec6c6277d46dc455a334bc54701919562d4a78
push id36935
push usercsabou@mozilla.com
push dateFri, 20 Dec 2019 15:52:27 +0000
treeherdermozilla-central@028b40d8140c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1570499
milestone73.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1570499 - Part 3: Remove MOZ_FALLTHROUGH macro definition. r=froydnj Differential Revision: https://phabricator.services.mozilla.com/D56442
mfbt/Attributes.h
--- a/mfbt/Attributes.h
+++ b/mfbt/Attributes.h
@@ -413,61 +413,16 @@
 #  define MOZ_MAYBE_UNUSED __pragma(warning(suppress : 4505))
 #else
 #  define MOZ_MAYBE_UNUSED
 #endif
 
 #ifdef __cplusplus
 
 /**
- * MOZ_FALLTHROUGH is an annotation to suppress compiler warnings about switch
- * cases that fall through without a break or return statement. MOZ_FALLTHROUGH
- * is only needed on cases that have code.
- *
- * MOZ_FALLTHROUGH_ASSERT is an annotation to suppress compiler warnings about
- * switch cases that MOZ_ASSERT(false) (or its alias MOZ_ASSERT_UNREACHABLE) in
- * debug builds, but intentionally fall through in release builds. See comment
- * in Assertions.h for more details.
- *
- * switch (foo) {
- *   case 1: // These cases have no code. No fallthrough annotations are needed.
- *   case 2:
- *   case 3: // This case has code, so a fallthrough annotation is needed!
- *     foo++;
- *     MOZ_FALLTHROUGH;
- *   case 4:
- *     return foo;
- *
- *   default:
- *     // This case asserts in debug builds, falls through in release.
- *     MOZ_FALLTHROUGH_ASSERT("Unexpected foo value?!");
- *   case 5:
- *     return 5;
- * }
- */
-#  ifndef __has_cpp_attribute
-#    define __has_cpp_attribute(x) 0
-#  endif
-
-#  if __has_cpp_attribute(clang::fallthrough)
-#    define MOZ_FALLTHROUGH [[clang::fallthrough]]
-#  elif __has_cpp_attribute(gnu::fallthrough)
-#    define MOZ_FALLTHROUGH [[gnu::fallthrough]]
-#  elif defined(_MSC_VER)
-/*
- * MSVC's __fallthrough annotations are checked by /analyze (Code Analysis):
- * https://msdn.microsoft.com/en-us/library/ms235402%28VS.80%29.aspx
- */
-#    include <sal.h>
-#    define MOZ_FALLTHROUGH __fallthrough
-#  else
-#    define MOZ_FALLTHROUGH /* FALLTHROUGH */
-#  endif
-
-/**
  * C++11 lets unions contain members that have non-trivial special member
  * functions (default/copy/move constructor, copy/move assignment operator,
  * destructor) if the user defines the corresponding functions on the union.
  * (Such user-defined functions must rely on external knowledge about which arm
  * is active to be safe.  Be extra-careful defining these functions!)
  *
  * MSVC unfortunately warns/errors for this bog-standard C++11 pattern.  Use
  * these macro-guards around such member functions to disable the warnings: