[cfe-commits] [libcxx] r162189 - /libcxx/trunk/include/__config

Howard Hinnant hhinnant at apple.com
Sun Aug 19 10:14:48 PDT 2012


Author: hhinnant
Date: Sun Aug 19 12:14:47 2012
New Revision: 162189

URL: http://llvm.org/viewvc/llvm-project?rev=162189&view=rev
Log:
In C++03 mode add an explicit conversion from int to the emulated class enum.  Fixes a problem reported by C. Bergström.

Modified:
    libcxx/trunk/include/__config

Modified: libcxx/trunk/include/__config
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__config?rev=162189&r1=162188&r2=162189&view=diff
==============================================================================
--- libcxx/trunk/include/__config (original)
+++ libcxx/trunk/include/__config Sun Aug 19 12:14:47 2012
@@ -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





More information about the cfe-commits mailing list