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

This commit is contained in:
Benoit Jacob 2014-04-27 22:46:40 -04:00
parent 89f10a3539
commit a8a9cf90c0

View File

@ -3,6 +3,7 @@
* 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"
@ -158,7 +159,8 @@ 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");