[PATCH] [libcxx] Take advantage of gcc4.7 frontend support in type_traits

Marshall Clow mclow.lists at gmail.com
Wed Jul 9 14:54:27 PDT 2014


I guess we're going to end up with a whole slew of macros for compiler capabilities.
I'd really rather keep the checking of compiler versions in __config as much as possible.

================
Comment at: include/type_traits:944
@@ -947,3 +943,3 @@
 
-#if __has_feature(is_empty)
+#if __has_feature(is_empty) || (_GNUC_VER >= 407)
 
----------------
I think I'd rather see a _LIBCPP_HAS_IS_EMPTY defined in __config, rather than adding this here.

See _LIBCPP_HAS_IS_BASE_OF for an similar case.

================
Comment at: include/type_traits:995
@@ -998,3 +994,3 @@
 
-#if __has_feature(has_virtual_destructor) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
+#if __has_feature(has_virtual_destructor) || (_GNUC_VER >= 403)
 
----------------
Same comment as line #944

================
Comment at: include/type_traits:2433
@@ -2436,3 +2432,3 @@
 struct _LIBCPP_TYPE_VIS_ONLY is_trivially_constructible<_Tp>
-#if __has_feature(has_trivial_constructor) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
+#if __has_feature(has_trivial_constructor) || (_GNUC_VER >= 403)
     : integral_constant<bool, __has_trivial_constructor(_Tp)>
----------------
Same comment as line #944

================
Comment at: include/type_traits:2618
@@ -2621,3 +2617,3 @@
 
-#if __has_feature(has_trivial_destructor) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
+#if __has_feature(has_trivial_destructor) || (_GNUC_VER >= 403)
 
----------------
Same comment as line #944

http://reviews.llvm.org/D4340






More information about the cfe-commits mailing list