Index: include/type_traits =================================================================== --- include/type_traits +++ include/type_traits @@ -376,13 +376,9 @@ template struct _LIBCPP_TYPE_VIS_ONLY is_reference<_Tp&&> : public true_type {}; #endif -#if defined(__clang__) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) -#define _LIBCPP_HAS_TYPE_TRAITS -#endif - // is_union -#if __has_feature(is_union) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) +#if __has_feature(is_union) || (_GNUC_VER >= 403) template struct _LIBCPP_TYPE_VIS_ONLY is_union : public integral_constant {}; @@ -397,7 +393,7 @@ // is_class -#if __has_feature(is_class) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) +#if __has_feature(is_class) || (_GNUC_VER >= 403) template struct _LIBCPP_TYPE_VIS_ONLY is_class : public integral_constant {}; @@ -484,7 +480,7 @@ // is_enum -#if __has_feature(is_enum) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) +#if __has_feature(is_enum) || (_GNUC_VER >= 403) template struct _LIBCPP_TYPE_VIS_ONLY is_enum : public integral_constant {}; @@ -797,7 +793,7 @@ struct _LIBCPP_TYPE_VIS_ONLY is_base_of : public integral_constant {}; -#else // __has_feature(is_base_of) +#else // _LIBCPP_HAS_IS_BASE_OF namespace __is_base_of_imp { @@ -822,7 +818,7 @@ : public integral_constant::value && sizeof(__is_base_of_imp::__test<_Bp, _Dp>(0)) == 2> {}; -#endif // __has_feature(is_base_of) +#endif // _LIBCPP_HAS_IS_BASE_OF // is_convertible @@ -945,7 +941,7 @@ // is_empty -#if __has_feature(is_empty) +#if __has_feature(is_empty) || (_GNUC_VER >= 407) template struct _LIBCPP_TYPE_VIS_ONLY is_empty @@ -996,17 +992,17 @@ // has_virtual_destructor -#if __has_feature(has_virtual_destructor) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) +#if __has_feature(has_virtual_destructor) || (_GNUC_VER >= 403) template struct _LIBCPP_TYPE_VIS_ONLY has_virtual_destructor : public integral_constant {}; -#else // _LIBCPP_HAS_TYPE_TRAITS +#else template struct _LIBCPP_TYPE_VIS_ONLY has_virtual_destructor : public false_type {}; -#endif // _LIBCPP_HAS_TYPE_TRAITS +#endif // alignment_of @@ -2434,7 +2430,7 @@ template 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 #else : integral_constant::value> @@ -2563,7 +2559,7 @@ // is_trivially_assignable -#if __has_feature(is_trivially_constructible) +#if __has_feature(is_trivially_assignable) template struct is_trivially_assignable @@ -2571,7 +2567,7 @@ { }; -#else // !__has_feature(is_trivially_constructible) +#else // !__has_feature(is_trivially_assignable) template struct is_trivially_assignable @@ -2597,7 +2593,7 @@ #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES -#endif // !__has_feature(is_trivially_constructible) +#endif // !__has_feature(is_trivially_assignable) // is_trivially_copy_assignable @@ -2619,12 +2615,12 @@ // is_trivially_destructible -#if __has_feature(has_trivial_destructor) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) +#if __has_feature(has_trivial_destructor) || (_GNUC_VER >= 403) template struct _LIBCPP_TYPE_VIS_ONLY is_trivially_destructible : public integral_constant {}; -#else // _LIBCPP_HAS_TYPE_TRAITS +#else template struct __libcpp_trivial_destructor : public integral_constant::value || @@ -2633,7 +2629,7 @@ template struct _LIBCPP_TYPE_VIS_ONLY is_trivially_destructible : public __libcpp_trivial_destructor::type> {}; -#endif // _LIBCPP_HAS_TYPE_TRAITS +#endif // is_nothrow_constructible @@ -2648,7 +2644,7 @@ #ifndef _LIBCPP_HAS_NO_VARIADICS -#if __has_feature(cxx_noexcept) +#if __has_feature(cxx_noexcept) || (_GNUC_VER >= 407 && __cplusplus >= 201103L) template struct __libcpp_is_nothrow_constructible; @@ -2686,7 +2682,7 @@ template struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp> -#if __has_feature(has_nothrow_constructor) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) +#if __has_feature(has_nothrow_constructor) || (_GNUC_VER >= 403) : integral_constant #else : integral_constant::value> @@ -2700,7 +2696,7 @@ #else struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp, _Tp> #endif -#if __has_feature(has_nothrow_copy) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) +#if __has_feature(has_nothrow_copy) || (_GNUC_VER >= 403) : integral_constant #else : integral_constant::value> @@ -2710,7 +2706,7 @@ template struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp, const _Tp&> -#if __has_feature(has_nothrow_copy) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) +#if __has_feature(has_nothrow_copy) || (_GNUC_VER >= 403) : integral_constant #else : integral_constant::value> @@ -2720,7 +2716,7 @@ template struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp, _Tp&> -#if __has_feature(has_nothrow_copy) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) +#if __has_feature(has_nothrow_copy) || (_GNUC_VER >= 403) : integral_constant #else : integral_constant::value> @@ -2742,7 +2738,7 @@ template struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp, __is_construct::__nat, __is_construct::__nat> -#if __has_feature(has_nothrow_constructor) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) +#if __has_feature(has_nothrow_constructor) || (_GNUC_VER >= 403) : integral_constant #else : integral_constant::value> @@ -2753,7 +2749,7 @@ template struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp, _Tp, __is_construct::__nat> -#if __has_feature(has_nothrow_copy) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) +#if __has_feature(has_nothrow_copy) || (_GNUC_VER >= 403) : integral_constant #else : integral_constant::value> @@ -2764,7 +2760,7 @@ template struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp, const _Tp&, __is_construct::__nat> -#if __has_feature(has_nothrow_copy) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) +#if __has_feature(has_nothrow_copy) || (_GNUC_VER >= 403) : integral_constant #else : integral_constant::value> @@ -2775,7 +2771,7 @@ template struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp, _Tp&, __is_construct::__nat> -#if __has_feature(has_nothrow_copy) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) +#if __has_feature(has_nothrow_copy) || (_GNUC_VER >= 403) : integral_constant #else : integral_constant::value> @@ -2810,7 +2806,7 @@ // is_nothrow_assignable -#if __has_feature(cxx_noexcept) +#if __has_feature(cxx_noexcept) || (_GNUC_VER >= 407 && __cplusplus >= 201103L) template struct __libcpp_is_nothrow_assignable; @@ -2840,7 +2836,7 @@ template struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_assignable<_Tp&, _Tp> -#if __has_feature(has_nothrow_assign) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) +#if __has_feature(has_nothrow_assign) || (_GNUC_VER >= 403) : integral_constant {}; #else : integral_constant::value> {}; @@ -2848,7 +2844,7 @@ template struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_assignable<_Tp&, _Tp&> -#if __has_feature(has_nothrow_assign) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) +#if __has_feature(has_nothrow_assign) || (_GNUC_VER >= 403) : integral_constant {}; #else : integral_constant::value> {}; @@ -2856,7 +2852,7 @@ template struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_assignable<_Tp&, const _Tp&> -#if __has_feature(has_nothrow_assign) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) +#if __has_feature(has_nothrow_assign) || (_GNUC_VER >= 403) : integral_constant {}; #else : integral_constant::value> {}; @@ -2866,7 +2862,7 @@ template struct is_nothrow_assignable<_Tp&, _Tp&&> -#if __has_feature(has_nothrow_assign) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) +#if __has_feature(has_nothrow_assign) || (_GNUC_VER >= 403) : integral_constant {}; #else : integral_constant::value> {}; @@ -2896,7 +2892,7 @@ // is_nothrow_destructible -#if __has_feature(cxx_noexcept) +#if __has_feature(cxx_noexcept) || (_GNUC_VER >= 407 && __cplusplus >= 201103L) template struct __libcpp_is_nothrow_destructible; @@ -2953,12 +2949,12 @@ // is_pod -#if __has_feature(is_pod) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) +#if __has_feature(is_pod) || (_GNUC_VER >= 403) template struct _LIBCPP_TYPE_VIS_ONLY is_pod : public integral_constant {}; -#else // _LIBCPP_HAS_TYPE_TRAITS +#else template struct _LIBCPP_TYPE_VIS_ONLY is_pod : public integral_constant::value && @@ -2966,7 +2962,7 @@ is_trivially_copy_assignable<_Tp>::value && is_trivially_destructible<_Tp>::value> {}; -#endif // _LIBCPP_HAS_TYPE_TRAITS +#endif // is_literal_type; @@ -2982,7 +2978,7 @@ // is_standard_layout; template struct _LIBCPP_TYPE_VIS_ONLY is_standard_layout -#if __has_feature(is_standard_layout) +#if __has_feature(is_standard_layout) || (_GNUC_VER >= 407) : public integral_constant #else : integral_constant::type>::value> @@ -3002,7 +2998,7 @@ // is_trivial; template struct _LIBCPP_TYPE_VIS_ONLY is_trivial -#if __has_feature(is_trivial) +#if __has_feature(is_trivial) || (_GNUC_VER >= 407) : public integral_constant #else : integral_constant::value && @@ -3332,7 +3328,7 @@ { }; -#if __has_feature(cxx_noexcept) +#if __has_feature(cxx_noexcept) || (_GNUC_VER >= 407 && __cplusplus >= 201103L) template struct __is_nothrow_swappable_imp