[cfe-commits] [libcxx] r150614 - /libcxx/trunk/include/type_traits

Howard Hinnant hhinnant at apple.com
Wed Feb 15 12:47:11 PST 2012


Author: hhinnant
Date: Wed Feb 15 14:47:11 2012
New Revision: 150614

URL: http://llvm.org/viewvc/llvm-project?rev=150614&view=rev
Log:
Use __is_polymorphic if available.  This fixes http://llvm.org/bugs/show_bug.cgi?id=11983 .  Patch contributed by Jonathan Sauer.

Modified:
    libcxx/trunk/include/type_traits

Modified: libcxx/trunk/include/type_traits
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/type_traits?rev=150614&r1=150613&r2=150614&view=diff
==============================================================================
--- libcxx/trunk/include/type_traits (original)
+++ libcxx/trunk/include/type_traits Wed Feb 15 14:47:11 2012
@@ -772,6 +772,14 @@
 
 // is_polymorphic
 
+#if __has_feature(is_polymorphic)
+
+template <class _Tp>
+struct _LIBCPP_VISIBLE is_polymorphic
+    : public integral_constant<bool, __is_polymorphic(_Tp)> {};
+
+#else
+
 template <class _Tp> struct __is_polymorphic1 : public _Tp {};
 template <class _Tp> struct __is_polymorphic2 : public _Tp {virtual ~__is_polymorphic2() throw();};
 
@@ -784,6 +792,8 @@
 template <class _Tp> struct _LIBCPP_VISIBLE is_polymorphic
     : public __libcpp_polymorphic<_Tp> {};
 
+#endif // __has_feature(is_polymorphic)
+
 // has_virtual_destructor
 
 #if __has_feature(has_virtual_destructor) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)





More information about the cfe-commits mailing list