In C++03 mode add an explicit conversion from int to the emulated class enum. Fixes a problem reported by C. Bergström. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@162189 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/__config b/include/__config index 530a320..f6ebdc7 100644 --- a/include/__config +++ b/include/__config
@@ -276,6 +276,7 @@ #elif defined(__GNUC__) #define _ALIGNAS(x) __attribute__((__aligned__(x))) +#define _ALIGNAS_TYPE(x) __attribute__((__aligned__(__alignof(x)))) #define _LIBCPP_NORETURN __attribute__((noreturn)) @@ -412,6 +413,7 @@ #define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x) \ _ __v_; \ _LIBCPP_ALWAYS_INLINE x(_ __v) : __v_(__v) {} \ + _LIBCPP_ALWAYS_INLINE explicit x(int __v) : __v_(static_cast<_>(__v)) {} \ _LIBCPP_ALWAYS_INLINE operator int() const {return __v_;} \ }; #else // _LIBCPP_HAS_NO_STRONG_ENUMS