Index: include/__config =================================================================== --- include/__config +++ include/__config @@ -519,13 +519,11 @@ #define _LIBCPP_NORETURN __attribute__((noreturn)) -#if _GNUC_VER >= 407 #define _LIBCPP_UNDERLYING_TYPE(T) __underlying_type(T) #define _LIBCPP_IS_LITERAL(T) __is_literal_type(T) #define _LIBCPP_HAS_IS_FINAL -#endif -#if defined(__GNUC__) && _GNUC_VER >= 403 +#if defined(__GNUC__) #define _LIBCPP_HAS_IS_BASE_OF #endif @@ -533,26 +531,19 @@ #define _LIBCPP_NO_EXCEPTIONS #endif -// constexpr was added to GCC in 4.6. -#if _GNUC_VER < 406 -# define _LIBCPP_HAS_NO_CONSTEXPR -// Can only use constexpr in c++11 mode. -#elif !defined(__GXX_EXPERIMENTAL_CXX0X__) && __cplusplus < 201103L -# define _LIBCPP_HAS_NO_CONSTEXPR -#endif - // Determine if GCC supports relaxed constexpr #if !defined(__cpp_constexpr) || __cpp_constexpr < 201304L #define _LIBCPP_HAS_NO_CXX14_CONSTEXPR #endif -// GCC 5 will support variable templates +// GCC 5 supports variable templates #if !defined(__cpp_variable_templates) || __cpp_variable_templates < 201304L #define _LIBCPP_HAS_NO_VARIABLE_TEMPLATES #endif #ifndef __GXX_EXPERIMENTAL_CXX0X__ +#define _LIBCPP_HAS_NO_CONSTEXPR #define _LIBCPP_HAS_NO_DECLTYPE #define _LIBCPP_HAS_NO_NULLPTR #define _LIBCPP_HAS_NO_UNICODE_CHARS @@ -561,25 +552,6 @@ #define _LIBCPP_HAS_NO_STRONG_ENUMS #define _LIBCPP_HAS_NO_NOEXCEPT -#else // __GXX_EXPERIMENTAL_CXX0X__ - -#if _GNUC_VER < 403 -#define _LIBCPP_HAS_NO_RVALUE_REFERENCES -#endif - - -#if _GNUC_VER < 404 -#define _LIBCPP_HAS_NO_DECLTYPE -#define _LIBCPP_HAS_NO_UNICODE_CHARS -#define _LIBCPP_HAS_NO_VARIADICS -#define _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS -#endif // _GNUC_VER < 404 - -#if _GNUC_VER < 406 -#define _LIBCPP_HAS_NO_NOEXCEPT -#define _LIBCPP_HAS_NO_NULLPTR -#endif - #endif // __GXX_EXPERIMENTAL_CXX0X__ #if !defined(_LIBCPP_HAS_NO_ASAN) && !defined(__SANITIZE_ADDRESS__) @@ -883,7 +855,7 @@ #ifdef _LIBCPP_HAS_NO_DECLTYPE // GCC 4.6 provides __decltype in all standard modes. -# if __has_keyword(__decltype) || _LIBCPP_CLANG_VER >= 304 || _GNUC_VER >= 406 +# if __has_keyword(__decltype) || _LIBCPP_CLANG_VER >= 304 || defined(_LIBCPP_COMPILER_GCC) # define decltype(__x) __decltype(__x) # else # define decltype(__x) __typeof__(__x) @@ -1219,7 +1191,7 @@ #if __has_feature(cxx_atomic) || __has_extension(c_atomic) || __has_keyword(_Atomic) # define _LIBCPP_HAS_C_ATOMIC_IMP -#elif _GNUC_VER > 407 +#elif defined(_LIBCPP_COMPILER_GCC) # define _LIBCPP_HAS_GCC_ATOMIC_IMP #endif Index: include/memory =================================================================== --- include/memory +++ include/memory @@ -683,7 +683,7 @@ _ValueType __libcpp_relaxed_load(_ValueType const* __value) { #if !defined(_LIBCPP_HAS_NO_THREADS) && \ defined(__ATOMIC_RELAXED) && \ - (__has_builtin(__atomic_load_n) || _GNUC_VER >= 407) + (__has_builtin(__atomic_load_n) || defined(_LIBCPP_COMPILER_GCC)) return __atomic_load_n(__value, __ATOMIC_RELAXED); #else return *__value; @@ -695,7 +695,7 @@ _ValueType __libcpp_acquire_load(_ValueType const* __value) { #if !defined(_LIBCPP_HAS_NO_THREADS) && \ defined(__ATOMIC_ACQUIRE) && \ - (__has_builtin(__atomic_load_n) || _GNUC_VER >= 407) + (__has_builtin(__atomic_load_n) || defined(_LIBCPP_COMPILER_GCC)) return __atomic_load_n(__value, __ATOMIC_ACQUIRE); #else return *__value; @@ -3466,7 +3466,7 @@ && defined(__ATOMIC_RELAXED) \ && defined(__ATOMIC_ACQ_REL) # define _LIBCPP_HAS_BUILTIN_ATOMIC_SUPPORT -#elif !defined(__clang__) && defined(_GNUC_VER) && _GNUC_VER >= 407 +#elif defined(_LIBCPP_COMPILER_GCC) # define _LIBCPP_HAS_BUILTIN_ATOMIC_SUPPORT #endif Index: include/type_traits =================================================================== --- include/type_traits +++ include/type_traits @@ -833,7 +833,7 @@ #endif // is_union -#if __has_feature(is_union) || (_GNUC_VER >= 403) +#if __has_feature(is_union) || defined(_LIBCPP_COMPILER_GCC) template struct _LIBCPP_TEMPLATE_VIS is_union : public integral_constant {}; @@ -854,7 +854,7 @@ // is_class -#if __has_feature(is_class) || (_GNUC_VER >= 403) +#if __has_feature(is_class) || defined(_LIBCPP_COMPILER_GCC) template struct _LIBCPP_TEMPLATE_VIS is_class : public integral_constant {}; @@ -976,7 +976,7 @@ // is_enum -#if __has_feature(is_enum) || (_GNUC_VER >= 403) +#if __has_feature(is_enum) || defined(_LIBCPP_COMPILER_GCC) template struct _LIBCPP_TEMPLATE_VIS is_enum : public integral_constant {}; @@ -1617,7 +1617,7 @@ // is_empty -#if __has_feature(is_empty) || (_GNUC_VER >= 407) +#if __has_feature(is_empty) || defined(_LIBCPP_COMPILER_GCC) template struct _LIBCPP_TEMPLATE_VIS is_empty @@ -1680,7 +1680,7 @@ // has_virtual_destructor -#if __has_feature(has_virtual_destructor) || (_GNUC_VER >= 403) +#if __has_feature(has_virtual_destructor) || defined(_LIBCPP_COMPILER_GCC) template struct _LIBCPP_TEMPLATE_VIS has_virtual_destructor : public integral_constant {}; @@ -2498,8 +2498,7 @@ typedef _Rp (_FnType) (_Param..., ...); }; -#if __has_feature(cxx_reference_qualified_functions) || \ - (defined(_GNUC_VER) && _GNUC_VER >= 409) +#if __has_feature(cxx_reference_qualified_functions) || defined(_LIBCPP_COMPILER_GCC) template struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) &, true, false> @@ -2629,7 +2628,7 @@ typedef _Rp (_FnType) (_Param..., ...); }; -#endif // __has_feature(cxx_reference_qualified_functions) || _GNUC_VER >= 409 +#endif // __has_feature(cxx_reference_qualified_functions) || defined(_LIBCPP_COMPILER_GCC) #else // _LIBCPP_HAS_NO_VARIADICS @@ -3503,7 +3502,7 @@ template struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible<_Tp> -#if __has_feature(has_trivial_constructor) || (_GNUC_VER >= 403) +#if __has_feature(has_trivial_constructor) || defined(_LIBCPP_COMPILER_GCC) : integral_constant #else : integral_constant::value> @@ -3734,7 +3733,7 @@ template struct _LIBCPP_TEMPLATE_VIS is_trivially_destructible : public integral_constant {}; -#elif __has_feature(has_trivial_destructor) || (_GNUC_VER >= 403) +#elif __has_feature(has_trivial_destructor) || defined(_LIBCPP_COMPILER_GCC) template struct _LIBCPP_TEMPLATE_VIS is_trivially_destructible : public integral_constant::value && __has_trivial_destructor(_Tp)> {}; @@ -3769,7 +3768,7 @@ struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible : public integral_constant {}; -#elif __has_feature(cxx_noexcept) || (_GNUC_VER >= 407 && __cplusplus >= 201103L) +#elif !defined(_LIBCPP_HAS_NO_NOEXCEPT) template struct __libcpp_is_nothrow_constructible; @@ -3806,7 +3805,7 @@ { }; -#else // __has_keyword(__is_nothrow_constructible) || __has_feature(cxx_noexcept) +#else // __has_keyword(__is_nothrow_constructible) || !defined(_LIBCPP_HAS_NO_NOEXCEPT) template struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible @@ -3816,7 +3815,7 @@ template struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible<_Tp> -#if __has_feature(has_nothrow_constructor) || (_GNUC_VER >= 403) +#if __has_feature(has_nothrow_constructor) || defined(_LIBCPP_COMPILER_GCC) : integral_constant #else : integral_constant::value> @@ -3830,7 +3829,7 @@ #else struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible<_Tp, _Tp> #endif -#if __has_feature(has_nothrow_copy) || (_GNUC_VER >= 403) +#if __has_feature(has_nothrow_copy) || defined(_LIBCPP_COMPILER_GCC) : integral_constant #else : integral_constant::value> @@ -3840,7 +3839,7 @@ template struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible<_Tp, const _Tp&> -#if __has_feature(has_nothrow_copy) || (_GNUC_VER >= 403) +#if __has_feature(has_nothrow_copy) || defined(_LIBCPP_COMPILER_GCC) : integral_constant #else : integral_constant::value> @@ -3850,7 +3849,7 @@ template struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible<_Tp, _Tp&> -#if __has_feature(has_nothrow_copy) || (_GNUC_VER >= 403) +#if __has_feature(has_nothrow_copy) || defined(_LIBCPP_COMPILER_GCC) : integral_constant #else : integral_constant::value> @@ -3858,7 +3857,7 @@ { }; -#endif // __has_feature(cxx_noexcept) +#endif // _LIBCPP_HAS_NO_NOEXCEPT #else // _LIBCPP_HAS_NO_VARIADICS @@ -3889,7 +3888,7 @@ template struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible<_Tp, __is_construct::__nat, __is_construct::__nat> -#if __has_feature(has_nothrow_constructor) || (_GNUC_VER >= 403) +#if __has_feature(has_nothrow_constructor) || defined(_LIBCPP_COMPILER_GCC) : integral_constant #else : integral_constant::value> @@ -3900,7 +3899,7 @@ template struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible<_Tp, _Tp, __is_construct::__nat> -#if __has_feature(has_nothrow_copy) || (_GNUC_VER >= 403) +#if __has_feature(has_nothrow_copy) || defined(_LIBCPP_COMPILER_GCC) : integral_constant #else : integral_constant::value> @@ -3911,7 +3910,7 @@ template struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible<_Tp, const _Tp&, __is_construct::__nat> -#if __has_feature(has_nothrow_copy) || (_GNUC_VER >= 403) +#if __has_feature(has_nothrow_copy) || defined(_LIBCPP_COMPILER_GCC) : integral_constant #else : integral_constant::value> @@ -3922,7 +3921,7 @@ template struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible<_Tp, _Tp&, __is_construct::__nat> -#if __has_feature(has_nothrow_copy) || (_GNUC_VER >= 403) +#if __has_feature(has_nothrow_copy) || defined(_LIBCPP_COMPILER_GCC) : integral_constant #else : integral_constant::value> @@ -3987,7 +3986,7 @@ struct _LIBCPP_TEMPLATE_VIS is_nothrow_assignable : public integral_constant {}; -#elif __has_feature(cxx_noexcept) || (_GNUC_VER >= 407 && __cplusplus >= 201103L) +#elif !defined(_LIBCPP_HAS_NO_NOEXCEPT) template struct __libcpp_is_nothrow_assignable; @@ -4009,7 +4008,7 @@ { }; -#else // __has_keyword(__is_nothrow_assignable) || __has_feature(cxx_noexcept) +#else // __has_keyword(__is_nothrow_assignable) || !defined(_LIBCPP_HAS_NO_NOEXCEPT) template struct _LIBCPP_TEMPLATE_VIS is_nothrow_assignable @@ -4017,7 +4016,7 @@ template struct _LIBCPP_TEMPLATE_VIS is_nothrow_assignable<_Tp&, _Tp> -#if __has_feature(has_nothrow_assign) || (_GNUC_VER >= 403) +#if __has_feature(has_nothrow_assign) || defined(_LIBCPP_COMPILER_GCC) : integral_constant {}; #else : integral_constant::value> {}; @@ -4025,7 +4024,7 @@ template struct _LIBCPP_TEMPLATE_VIS is_nothrow_assignable<_Tp&, _Tp&> -#if __has_feature(has_nothrow_assign) || (_GNUC_VER >= 403) +#if __has_feature(has_nothrow_assign) || defined(_LIBCPP_COMPILER_GCC) : integral_constant {}; #else : integral_constant::value> {}; @@ -4033,7 +4032,7 @@ template struct _LIBCPP_TEMPLATE_VIS is_nothrow_assignable<_Tp&, const _Tp&> -#if __has_feature(has_nothrow_assign) || (_GNUC_VER >= 403) +#if __has_feature(has_nothrow_assign) || defined(_LIBCPP_COMPILER_GCC) : integral_constant {}; #else : integral_constant::value> {}; @@ -4043,7 +4042,7 @@ template struct is_nothrow_assignable<_Tp&, _Tp&&> -#if __has_feature(has_nothrow_assign) || (_GNUC_VER >= 403) +#if __has_feature(has_nothrow_assign) || defined(_LIBCPP_COMPILER_GCC) : integral_constant {}; #else : integral_constant::value> {}; @@ -4051,7 +4050,7 @@ #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES -#endif // __has_feature(cxx_noexcept) +#endif // _LIBCPP_HAS_NO_NOEXCEPT #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) template @@ -4090,7 +4089,7 @@ // is_nothrow_destructible -#if __has_feature(cxx_noexcept) || (_GNUC_VER >= 407 && __cplusplus >= 201103L) +#if !defined(_LIBCPP_HAS_NO_NOEXCEPT) template struct __libcpp_is_nothrow_destructible; @@ -4157,7 +4156,7 @@ // is_pod -#if __has_feature(is_pod) || (_GNUC_VER >= 403) +#if __has_feature(is_pod) || defined(_LIBCPP_COMPILER_GCC) template struct _LIBCPP_TEMPLATE_VIS is_pod : public integral_constant {}; @@ -4198,7 +4197,7 @@ // is_standard_layout; template struct _LIBCPP_TEMPLATE_VIS is_standard_layout -#if __has_feature(is_standard_layout) || (_GNUC_VER >= 407) +#if __has_feature(is_standard_layout) || defined(_LIBCPP_COMPILER_GCC) : public integral_constant #else : integral_constant::type>::value> @@ -4232,7 +4231,7 @@ // is_trivial; template struct _LIBCPP_TEMPLATE_VIS is_trivial -#if __has_feature(is_trivial) || _GNUC_VER >= 407 +#if __has_feature(is_trivial) || defined(_LIBCPP_COMPILER_GCC) : public integral_constant #else : integral_constant::value &&