forked from OSchip/llvm-project
In C++03 mode add an explicit conversion from int to the emulated class enum. Fixes a problem reported by C. Bergström.
llvm-svn: 162189
This commit is contained in:
parent
e4b2a743b8
commit
a3b7a802cc
|
@ -276,6 +276,7 @@ namespace std {
|
|||
#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 @@ template <unsigned> struct __static_assert_check {};
|
|||
#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
|
||||
|
|
Loading…
Reference in New Issue