Bug 987290 - Follow-up: fix TestTypedEnum to avoid requiring behavior that relies on explicit conversions, when they are not available. Fixes the build on MSVC 2012 - no review, bustage fix
authorBenoit Jacob <bjacob@mozilla.com>
Sun, 27 Apr 2014 22:46:40 -0400
changeset 199000 ba55dd0b1a12bcc3462d7b4357e20ea1dbf2f007
parent 198999 2b71adff7fe47c450de4b87d2bf4a08db841338e
child 199001 3a49b88c5bb05b15aabcde775e18aa405c0bf7a1
push id3624
push userasasaki@mozilla.com
push dateMon, 09 Jun 2014 21:49:01 +0000
treeherdermozilla-beta@b1a5da15899a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs987290
milestone31.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 987290 - Follow-up: fix TestTypedEnum to avoid requiring behavior that relies on explicit conversions, when they are not available. Fixes the build on MSVC 2012 - no review, bustage fix
mfbt/tests/TestTypedEnum.cpp
--- a/mfbt/tests/TestTypedEnum.cpp
+++ b/mfbt/tests/TestTypedEnum.cpp
@@ -1,13 +1,14 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/Assertions.h"
+#include "mozilla/Attributes.h"
 #include "mozilla/TypedEnum.h"
 #include "mozilla/TypedEnumBits.h"
 
 #include <stdint.h>
 
 // A rough feature check for is_literal_type. Not very carefully checked.
 // Feel free to amend as needed.
 // We leave ANDROID out because it's using stlport which doesn't have std::is_literal_type.
@@ -153,17 +154,18 @@ MAKE_STANDARD_BITFIELD_FOR_TYPE(unsigned
 
 #undef MAKE_STANDARD_BITFIELD_FOR_TYPE
 
 template<typename T>
 void
 TestNonConvertibilityForOneType()
 {
   using mozilla::IsConvertible;
-#ifdef MOZ_HAVE_CXX11_STRONG_ENUMS
+
+#if defined(MOZ_HAVE_CXX11_STRONG_ENUMS) && defined(MOZ_HAVE_EXPLICIT_CONVERSION)
   static_assert(!IsConvertible<T, bool>::value, "should not be convertible");
   static_assert(!IsConvertible<T, int>::value, "should not be convertible");
   static_assert(!IsConvertible<T, uint64_t>::value, "should not be convertible");
 #endif
 
   static_assert(!IsConvertible<bool, T>::value, "should not be convertible");
   static_assert(!IsConvertible<int, T>::value, "should not be convertible");
   static_assert(!IsConvertible<uint64_t, T>::value, "should not be convertible");