summaryrefslogtreecommitdiffstats
path: root/libcxx/include
diff options
context:
space:
mode:
authorHoward Hinnant <hhinnant@apple.com>2010-09-07 17:15:17 +0000
committerHoward Hinnant <hhinnant@apple.com>2010-09-07 17:15:17 +0000
commitf336abfcd2449b60bbbed8595c450f3b1583c7e3 (patch)
treebd791cddde0f128523f444f60968e95b5c04744f /libcxx/include
parent881c371af33bcd6d5dab9e18d7eeaeb428b989c1 (diff)
downloadbcm5719-llvm-f336abfcd2449b60bbbed8595c450f3b1583c7e3.tar.gz
bcm5719-llvm-f336abfcd2449b60bbbed8595c450f3b1583c7e3.zip
has_nothrow_default_constructor hooked up to clang. Filed http://llvm.org/bugs/show_bug.cgi?id=8101 to take care of void, arrays of incomplete types, and classes with virtual destructors which don't work yet. If there is some reasons we don't want to handle these types in the compiler, I can handle them in the library.
llvm-svn: 113217
Diffstat (limited to 'libcxx/include')
-rw-r--r--libcxx/include/type_traits12
1 files changed, 11 insertions, 1 deletions
diff --git a/libcxx/include/type_traits b/libcxx/include/type_traits
index 1095fb4cd59..7a3b81fc6e3 100644
--- a/libcxx/include/type_traits
+++ b/libcxx/include/type_traits
@@ -714,7 +714,17 @@ template <class _Tp> struct has_trivial_default_constructor
// has_nothrow_default_constructor
-template <class _Tp> struct has_nothrow_default_constructor : public has_trivial_default_constructor<_Tp> {};
+#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 || defined(__clang__)
+
+template <class _Tp> struct has_nothrow_default_constructor
+ : public integral_constant<bool, __has_nothrow_constructor(_Tp)> {};
+
+#else // __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 || defined(__clang__)
+
+template <class _Tp> struct has_nothrow_default_constructor
+ : public has_trivial_default_constructor<_Tp> {};
+
+#endif // __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 || defined(__clang__)
// has_trivial_copy_constructor
OpenPOWER on IntegriCloud