From ffab05833fee2beec500705faf3d01389e53b31c Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Sun, 19 Aug 2012 17:14:47 +0000 Subject: [PATCH] =?UTF-8?q?In=20C++03=20mode=20add=20an=20explicit=20conve?= =?UTF-8?q?rsion=20from=20int=20to=20the=20emulated=20class=20enum.=20=20F?= =?UTF-8?q?ixes=20a=20problem=20reported=20by=20C.=20Bergstr=C3=B6m.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@162189 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/__config | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/__config b/include/__config index 530a3204c..f6ebdc7eb 100644 --- a/include/__config +++ b/include/__config @@ -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 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