Bug 713560 - Make MOZ_STATIC_ASSERT, when it expands to C++11 static_cast(), pass its reason argument along to static_cast in more compilers. r=typo-fix
authorJeff Walden <jwalden@mit.edu>
Tue, 27 Dec 2011 12:09:41 -0600
changeset 83409 3b3f1c6d6983df7f479282026813ade81a56b6ed
parent 83408 d7999840fac58306befe2f6a699dd41be916da0d
child 83410 18eead5419ff486cb13818ef6419bd39d4940524
push id21760
push usermbrubeck@mozilla.com
push dateWed, 28 Dec 2011 19:04:19 +0000
treeherdermozilla-central@010fe7e7df1a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstypo-fix
bugs713560
milestone12.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 713560 - Make MOZ_STATIC_ASSERT, when it expands to C++11 static_cast(), pass its reason argument along to static_cast in more compilers. r=typo-fix
mfbt/Assertions.h
--- a/mfbt/Assertions.h
+++ b/mfbt/Assertions.h
@@ -65,25 +65,25 @@
 #      define __has_extension __has_feature /* compatibility, for older versions of clang */
 #    endif
 #    if __has_extension(cxx_static_assert)
 #      define MOZ_STATIC_ASSERT(cond, reason)    static_assert((cond), reason)
 #    endif
 #  elif defined(__GNUC__)
 #    if (defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L) && \
         (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
-#      define MOZ_STATIC_ASSERT(cond, reason)    static_assert((cond), #cond)
+#      define MOZ_STATIC_ASSERT(cond, reason)    static_assert((cond), reason)
 #    endif
 #  elif defined(_MSC_VER)
 #    if _MSC_VER >= 1600 /* MSVC 10 */
-#      define MOZ_STATIC_ASSERT(cond, reason)    static_assert((cond), #cond)
+#      define MOZ_STATIC_ASSERT(cond, reason)    static_assert((cond), reason)
 #    endif
 #  elif defined(__HP_aCC)
 #    if __HP_aCC >= 62500 && defined(_HP_CXX0x_SOURCE)
-#      define MOZ_STATIC_ASSERT(cond, reason)    static_assert((cond), #cond)
+#      define MOZ_STATIC_ASSERT(cond, reason)    static_assert((cond), reason)
 #    endif
 #  endif
 #endif
 #ifndef MOZ_STATIC_ASSERT
 #  define MOZ_STATIC_ASSERT_GLUE1(x, y)          x##y
 #  define MOZ_STATIC_ASSERT_GLUE(x, y)           MOZ_STATIC_ASSERT_GLUE1(x, y)
 #  if defined(__SUNPRO_CC)
      /*