diff --git a/include/type_traits b/include/type_traits index 1095fb4cd..7a3b81fc6 100644 --- a/include/type_traits +++ b/include/type_traits @@ -714,7 +714,17 @@ template struct has_trivial_default_constructor // has_nothrow_default_constructor -template struct has_nothrow_default_constructor : public has_trivial_default_constructor<_Tp> {}; +#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 || defined(__clang__) + +template struct has_nothrow_default_constructor + : public integral_constant {}; + +#else // __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 || defined(__clang__) + +template struct has_nothrow_default_constructor + : public has_trivial_default_constructor<_Tp> {}; + +#endif // __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 || defined(__clang__) // has_trivial_copy_constructor diff --git a/test/utilities/meta/meta.unary/meta.unary.prop/has_nothrow_default_constructor.pass.cpp b/test/utilities/meta/meta.unary/meta.unary.prop/has_nothrow_default_constructor.pass.cpp index cc4a45809..8a5336d0d 100644 --- a/test/utilities/meta/meta.unary/meta.unary.prop/has_nothrow_default_constructor.pass.cpp +++ b/test/utilities/meta/meta.unary/meta.unary.prop/has_nothrow_default_constructor.pass.cpp @@ -62,16 +62,16 @@ int main() test_has_not_nothrow_default_constructor(); test_has_not_nothrow_default_constructor(); test_has_not_nothrow_default_constructor(); + test_has_not_nothrow_default_constructor(); + test_has_not_nothrow_default_constructor(); test_has_nothrow_default_constructor(); - test_has_nothrow_default_constructor(); test_has_nothrow_default_constructor(); test_has_nothrow_default_constructor(); test_has_nothrow_default_constructor(); test_has_nothrow_default_constructor(); test_has_nothrow_default_constructor(); test_has_nothrow_default_constructor(); - test_has_nothrow_default_constructor(); test_has_nothrow_default_constructor(); test_has_nothrow_default_constructor(); }