Index: include/__config =================================================================== --- include/__config +++ include/__config @@ -765,10 +765,28 @@ # endif #endif // _LIBCPP_STD_VER +#if __cplusplus < 201103L +#define _LIBCPP_CXX03_LANG +#else +#if defined(_LIBCPP_HAS_NO_VARIADIC_TEMPLATES) || defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) +#error Libc++ requires a feature complete C++11 compiler in C++11 or greater. +#endif +#endif + #if _LIBCPP_STD_VER > 11 #define _LIBCPP_DEPRECATED [[deprecated]] #else -#define _LIBCPP_DEPRECATED +#define _LIBCPP_DEPRECATED __attribute__((__deprecated__)) +#endif + +#ifdef _LIBCPP_CXX03_LANG +#if __has_extension(attribute_deprecated_with_message) +#define _LIBCPP_DEPRECATED_CXX03_EXTENSION(__msg) __attribute__((__deprecated__(__msg))) +#else +#define _LIBCPP_DEPRECATED_CXX03_EXTENSION(__msg) __attribute__((__deprecated__)) +#endif +#else +#define _LIBCPP_DEPRECATED_CXX03_EXTENSION(__msg) #endif #if _LIBCPP_STD_VER <= 11 @@ -863,13 +881,6 @@ #define _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK #endif -#if __cplusplus < 201103L -#define _LIBCPP_CXX03_LANG -#else -#if defined(_LIBCPP_HAS_NO_VARIADIC_TEMPLATES) || defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) -#error Libc++ requires a feature complete C++11 compiler in C++11 or greater. -#endif -#endif #if (defined(_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS) && defined(__clang__) \ && __has_attribute(acquire_capability)) Index: include/__functional_03 =================================================================== --- include/__functional_03 +++ include/__functional_03 @@ -445,7 +445,9 @@ } // __function template -class _LIBCPP_TYPE_VIS_ONLY function<_Rp()> +class _LIBCPP_TYPE_VIS_ONLY + _LIBCPP_DEPRECATED_CXX03_EXTENSION("std::function requires C++11 or newer") + function<_Rp()> { typedef __function::__base<_Rp()> __base; aligned_storage<3*sizeof(void*)>::type __buf_; @@ -720,7 +722,9 @@ #endif // _LIBCPP_NO_RTTI template -class _LIBCPP_TYPE_VIS_ONLY function<_Rp(_A0)> +class _LIBCPP_TYPE_VIS_ONLY + _LIBCPP_DEPRECATED_CXX03_EXTENSION("std::function requires C++11 or newer") + function<_Rp(_A0)> : public unary_function<_A0, _Rp> { typedef __function::__base<_Rp(_A0)> __base; @@ -996,7 +1000,9 @@ #endif // _LIBCPP_NO_RTTI template -class _LIBCPP_TYPE_VIS_ONLY function<_Rp(_A0, _A1)> +class _LIBCPP_TYPE_VIS_ONLY + _LIBCPP_DEPRECATED_CXX03_EXTENSION("std::function requires C++11 or newer") + function<_Rp(_A0, _A1)> : public binary_function<_A0, _A1, _Rp> { typedef __function::__base<_Rp(_A0, _A1)> __base; @@ -1272,7 +1278,9 @@ #endif // _LIBCPP_NO_RTTI template -class _LIBCPP_TYPE_VIS_ONLY function<_Rp(_A0, _A1, _A2)> +class _LIBCPP_TYPE_VIS_ONLY + _LIBCPP_DEPRECATED_CXX03_EXTENSION("std::function requires C++11 or newer") + function<_Rp(_A0, _A1, _A2)> { typedef __function::__base<_Rp(_A0, _A1, _A2)> __base; aligned_storage<3*sizeof(void*)>::type __buf_; Index: include/__functional_base =================================================================== --- include/__functional_base +++ include/__functional_base @@ -462,7 +462,8 @@ }; template -class _LIBCPP_TYPE_VIS_ONLY reference_wrapper +class _LIBCPP_TYPE_VIS_ONLY + reference_wrapper : public __weak_result_type<_Tp> { public: @@ -492,8 +493,8 @@ return __invoke(get(), _VSTD::forward<_ArgTypes>(__args)...); } #else - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_DEPRECATED_CXX03_EXTENSION("invoking reference_wrapper requires C++11 or newer") typename __invoke_return::type operator() () const { return __invoke(get()); @@ -501,6 +502,7 @@ template _LIBCPP_INLINE_VISIBILITY + _LIBCPP_DEPRECATED_CXX03_EXTENSION("invoking reference_wrapper requires C++11 or newer") typename __invoke_return0::type operator() (_A0& __a0) const { return __invoke(get(), __a0); @@ -508,6 +510,7 @@ template _LIBCPP_INLINE_VISIBILITY + _LIBCPP_DEPRECATED_CXX03_EXTENSION("invoking reference_wrapper requires C++11 or newer") typename __invoke_return0::type operator() (_A0 const& __a0) const { return __invoke(get(), __a0); @@ -515,6 +518,7 @@ template _LIBCPP_INLINE_VISIBILITY + _LIBCPP_DEPRECATED_CXX03_EXTENSION("invoking reference_wrapper requires C++11 or newer") typename __invoke_return1::type operator() (_A0& __a0, _A1& __a1) const { return __invoke(get(), __a0, __a1); @@ -522,6 +526,7 @@ template _LIBCPP_INLINE_VISIBILITY + _LIBCPP_DEPRECATED_CXX03_EXTENSION("invoking reference_wrapper requires C++11 or newer") typename __invoke_return1::type operator() (_A0 const& __a0, _A1& __a1) const { return __invoke(get(), __a0, __a1); @@ -529,6 +534,7 @@ template _LIBCPP_INLINE_VISIBILITY + _LIBCPP_DEPRECATED_CXX03_EXTENSION("invoking reference_wrapper requires C++11 or newer") typename __invoke_return1::type operator() (_A0& __a0, _A1 const& __a1) const { return __invoke(get(), __a0, __a1); @@ -536,6 +542,7 @@ template _LIBCPP_INLINE_VISIBILITY + _LIBCPP_DEPRECATED_CXX03_EXTENSION("invoking reference_wrapper requires C++11 or newer") typename __invoke_return1::type operator() (_A0 const& __a0, _A1 const& __a1) const { return __invoke(get(), __a0, __a1); @@ -543,6 +550,7 @@ template _LIBCPP_INLINE_VISIBILITY + _LIBCPP_DEPRECATED_CXX03_EXTENSION("invoking reference_wrapper requires C++11 or newer") typename __invoke_return2::type operator() (_A0& __a0, _A1& __a1, _A2& __a2) const { return __invoke(get(), __a0, __a1, __a2); @@ -550,6 +558,7 @@ template _LIBCPP_INLINE_VISIBILITY + _LIBCPP_DEPRECATED_CXX03_EXTENSION("invoking reference_wrapper requires C++11 or newer") typename __invoke_return2::type operator() (_A0 const& __a0, _A1& __a1, _A2& __a2) const { return __invoke(get(), __a0, __a1, __a2); @@ -557,6 +566,7 @@ template _LIBCPP_INLINE_VISIBILITY + _LIBCPP_DEPRECATED_CXX03_EXTENSION("invoking reference_wrapper requires C++11 or newer") typename __invoke_return2::type operator() (_A0& __a0, _A1 const& __a1, _A2& __a2) const { return __invoke(get(), __a0, __a1, __a2); @@ -564,6 +574,7 @@ template _LIBCPP_INLINE_VISIBILITY + _LIBCPP_DEPRECATED_CXX03_EXTENSION("invoking reference_wrapper requires C++11 or newer") typename __invoke_return2::type operator() (_A0& __a0, _A1& __a1, _A2 const& __a2) const { return __invoke(get(), __a0, __a1, __a2); @@ -571,6 +582,7 @@ template _LIBCPP_INLINE_VISIBILITY + _LIBCPP_DEPRECATED_CXX03_EXTENSION("invoking reference_wrapper requires C++11 or newer") typename __invoke_return2::type operator() (_A0 const& __a0, _A1 const& __a1, _A2& __a2) const { return __invoke(get(), __a0, __a1, __a2); @@ -578,6 +590,7 @@ template _LIBCPP_INLINE_VISIBILITY + _LIBCPP_DEPRECATED_CXX03_EXTENSION("invoking reference_wrapper requires C++11 or newer") typename __invoke_return2::type operator() (_A0 const& __a0, _A1& __a1, _A2 const& __a2) const { return __invoke(get(), __a0, __a1, __a2); @@ -585,6 +598,7 @@ template _LIBCPP_INLINE_VISIBILITY + _LIBCPP_DEPRECATED_CXX03_EXTENSION("invoking reference_wrapper requires C++11 or newer") typename __invoke_return2::type operator() (_A0& __a0, _A1 const& __a1, _A2 const& __a2) const { return __invoke(get(), __a0, __a1, __a2); @@ -592,6 +606,7 @@ template _LIBCPP_INLINE_VISIBILITY + _LIBCPP_DEPRECATED_CXX03_EXTENSION("invoking reference_wrapper requires C++11 or newer") typename __invoke_return2::type operator() (_A0 const& __a0, _A1 const& __a1, _A2 const& __a2) const { return __invoke(get(), __a0, __a1, __a2); Index: include/functional =================================================================== --- include/functional +++ include/functional @@ -1363,6 +1363,7 @@ template inline _LIBCPP_INLINE_VISIBILITY +_LIBCPP_DEPRECATED_CXX03_EXTENSION("std::mem_fn requires C++11 or newer") __mem_fn<_Rp _Tp::*> mem_fn(_Rp _Tp::* __pm) _NOEXCEPT {