summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2016-09-25 03:34:28 +0000
committerEric Fiselier <eric@efcs.ca>2016-09-25 03:34:28 +0000
commit4e3e15ad994eab09d83c1d5602597babca1d2756 (patch)
treee1c3a9861afb3a44b43de961c497516f2a0c58c9 /include
parent1deaf196f43b3c54140b59ca483008cb75e6e936 (diff)
[libc++] Remove various C++03 feature test macros
Summary: Libc++ still uses per-feature configuration macros when configuring for C++11. However libc++ requires a feature-complete C++11 compiler so there is no reason to check individual features. This patch starts the process of removing the feature specific macros and replacing their usage with `_LIBCPP_CXX03_LANG`. This patch removes the __config macros: * _LIBCPP_HAS_NO_TRAILING_RETURN * _LIBCPP_HAS_NO_TEMPLATE_ALIASES * _LIBCPP_HAS_NO_ADVANCED_SFINAE * _LIBCPP_HAS_NO_DEFAULT_FUNCTION_TEMPLATE_ARGS * _LIBCPP_HAS_NO_STATIC_ASSERT As a drive I also changed our C++03 static_assert to use _Static_assert if available. I plan to commit this without review if nobody voices an objection. Reviewers: mclow.lists Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D24895 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@282347 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/__config55
-rw-r--r--include/iterator6
-rw-r--r--include/memory46
-rw-r--r--include/ratio24
-rw-r--r--include/scoped_allocator4
-rw-r--r--include/type_traits6
6 files changed, 52 insertions, 89 deletions
diff --git a/include/__config b/include/__config
index 56326af1a..9f90a5bd3 100644
--- a/include/__config
+++ b/include/__config
@@ -68,6 +68,9 @@
#define _LIBCPP_NAMESPACE _LIBCPP_CONCAT(__,_LIBCPP_ABI_VERSION)
+#if __cplusplus < 201103L
+#define _LIBCPP_CXX03_LANG
+#endif
#ifndef __has_attribute
#define __has_attribute(__x) 0
@@ -229,10 +232,6 @@
# define _ALIGNAS(x) __attribute__((__aligned__(x)))
#endif
-#if !__has_feature(cxx_alias_templates)
-#define _LIBCPP_HAS_NO_TEMPLATE_ALIASES
-#endif
-
#if __cplusplus < 201103L
typedef __char16_t char16_t;
typedef __char32_t char32_t;
@@ -260,10 +259,6 @@ typedef __char32_t char32_t;
# define _LIBCPP_NORETURN __attribute__ ((noreturn))
#endif
-#if !(__has_feature(cxx_default_function_template_args))
-#define _LIBCPP_HAS_NO_DEFAULT_FUNCTION_TEMPLATE_ARGS
-#endif
-
#if !(__has_feature(cxx_defaulted_functions))
#define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
#endif // !(__has_feature(cxx_defaulted_functions))
@@ -284,26 +279,14 @@ typedef __char32_t char32_t;
#define _LIBCPP_HAS_NO_RVALUE_REFERENCES
#endif
-#if !(__has_feature(cxx_static_assert))
-#define _LIBCPP_HAS_NO_STATIC_ASSERT
-#endif
-
#if !(__has_feature(cxx_auto_type))
#define _LIBCPP_HAS_NO_AUTO_TYPE
#endif
-#if !(__has_feature(cxx_access_control_sfinae)) || !__has_feature(cxx_trailing_return)
-#define _LIBCPP_HAS_NO_ADVANCED_SFINAE
-#endif
-
#if !(__has_feature(cxx_variadic_templates))
#define _LIBCPP_HAS_NO_VARIADICS
#endif
-#if !(__has_feature(cxx_trailing_return))
-#define _LIBCPP_HAS_NO_TRAILING_RETURN
-#endif
-
#if !(__has_feature(cxx_generalized_initializers))
#define _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
#endif
@@ -428,34 +411,26 @@ namespace std {
#endif
#ifndef __GXX_EXPERIMENTAL_CXX0X__
-
-#define _LIBCPP_HAS_NO_ADVANCED_SFINAE
#define _LIBCPP_HAS_NO_DECLTYPE
-#define _LIBCPP_HAS_NO_DEFAULT_FUNCTION_TEMPLATE_ARGS
#define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
#define _LIBCPP_HAS_NO_DELETED_FUNCTIONS
#define _LIBCPP_HAS_NO_NULLPTR
-#define _LIBCPP_HAS_NO_STATIC_ASSERT
#define _LIBCPP_HAS_NO_UNICODE_CHARS
#define _LIBCPP_HAS_NO_VARIADICS
#define _LIBCPP_HAS_NO_RVALUE_REFERENCES
#define _LIBCPP_HAS_NO_STRONG_ENUMS
-#define _LIBCPP_HAS_NO_TEMPLATE_ALIASES
#define _LIBCPP_HAS_NO_NOEXCEPT
#else // __GXX_EXPERIMENTAL_CXX0X__
#if _GNUC_VER < 403
-#define _LIBCPP_HAS_NO_DEFAULT_FUNCTION_TEMPLATE_ARGS
#define _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#define _LIBCPP_HAS_NO_STATIC_ASSERT
#endif
#if _GNUC_VER < 404
#define _LIBCPP_HAS_NO_DECLTYPE
#define _LIBCPP_HAS_NO_DELETED_FUNCTIONS
-#define _LIBCPP_HAS_NO_TRAILING_RETURN
#define _LIBCPP_HAS_NO_UNICODE_CHARS
#define _LIBCPP_HAS_NO_VARIADICS
#define _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
@@ -464,11 +439,9 @@ namespace std {
#if _GNUC_VER < 406
#define _LIBCPP_HAS_NO_NOEXCEPT
#define _LIBCPP_HAS_NO_NULLPTR
-#define _LIBCPP_HAS_NO_TEMPLATE_ALIASES
#endif
#if _GNUC_VER < 407
-#define _LIBCPP_HAS_NO_ADVANCED_SFINAE
#define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
#endif
@@ -490,7 +463,6 @@ using namespace _LIBCPP_NAMESPACE __attribute__((__strong__));
#elif defined(_LIBCPP_MSVC)
-#define _LIBCPP_HAS_NO_TEMPLATE_ALIASES
#define _LIBCPP_HAS_NO_CONSTEXPR
#define _LIBCPP_HAS_NO_CXX14_CONSTEXPR
#define _LIBCPP_HAS_NO_VARIABLE_TEMPLATES
@@ -520,9 +492,6 @@ namespace std {
#define _ATTRIBUTE(x) __attribute__((x))
#define _LIBCPP_NORETURN __attribute__((noreturn))
-#define _LIBCPP_HAS_NO_DEFAULT_FUNCTION_TEMPLATE_ARGS
-#define _LIBCPP_HAS_NO_TEMPLATE_ALIASES
-#define _LIBCPP_HAS_NO_ADVANCED_SFINAE
#define _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
#define _LIBCPP_HAS_NO_NOEXCEPT
#define _LIBCPP_HAS_NO_NULLPTR
@@ -677,8 +646,10 @@ typedef unsigned int char32_t;
#define _LIBCPP_HAS_NO_INT128
#endif
-#ifdef _LIBCPP_HAS_NO_STATIC_ASSERT
-
+#ifdef _LIBCPP_CXX03_LANG
+# if __has_extension(c_static_assert)
+# define static_assert(__b, __m) _Static_assert(__b, __m)
+# else
extern "C++" {
template <bool> struct __static_assert_test;
template <> struct __static_assert_test<true> {};
@@ -687,8 +658,8 @@ template <unsigned> struct __static_assert_check {};
#define static_assert(__b, __m) \
typedef __static_assert_check<sizeof(__static_assert_test<(__b)>)> \
_LIBCPP_CONCAT(__t, __LINE__)
-
-#endif // _LIBCPP_HAS_NO_STATIC_ASSERT
+# endif // __has_extension(c_static_assert)
+#endif // _LIBCPP_CXX03_LANG
#ifdef _LIBCPP_HAS_NO_DECLTYPE
// GCC 4.6 provides __decltype in all standard modes.
@@ -934,14 +905,6 @@ extern "C" void __sanitizer_annotate_contiguous_container(
#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))
#define _LIBCPP_HAS_THREAD_SAFETY_ANNOTATIONS
diff --git a/include/iterator b/include/iterator
index 0caabbb2e..188a48049 100644
--- a/include/iterator
+++ b/include/iterator
@@ -1566,7 +1566,7 @@ end(_Tp (&__array)[_Np])
return __array + _Np;
}
-#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_TRAILING_RETURN)
+#if !defined(_LIBCPP_CXX03_LANG)
template <class _Cp>
inline _LIBCPP_INLINE_VISIBILITY
@@ -1689,7 +1689,7 @@ auto crend(const _Cp& __c) -> decltype(_VSTD::rend(__c))
#endif
-#else // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_TRAILING_RETURN)
+#else // defined(_LIBCPP_CXX03_LANG)
template <class _Cp>
inline _LIBCPP_INLINE_VISIBILITY
@@ -1723,7 +1723,7 @@ end(const _Cp& __c)
return __c.end();
}
-#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_TRAILING_RETURN)
+#endif // !defined(_LIBCPP_CXX03_LANG)
#if _LIBCPP_STD_VER > 14
template <class _Cont>
diff --git a/include/memory b/include/memory
index 8cb094e6b..d5b39cbae 100644
--- a/include/memory
+++ b/include/memory
@@ -828,7 +828,7 @@ public:
template <class _Tp, class _Up, bool = __has_rebind<_Tp, _Up>::value>
struct __pointer_traits_rebind
{
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#ifndef _LIBCPP_CXX03_LANG
typedef typename _Tp::template rebind<_Up> type;
#else
typedef typename _Tp::template rebind<_Up>::other type;
@@ -840,7 +840,7 @@ struct __pointer_traits_rebind
template <template <class, class...> class _Sp, class _Tp, class ..._Args, class _Up>
struct __pointer_traits_rebind<_Sp<_Tp, _Args...>, _Up, true>
{
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#ifndef _LIBCPP_CXX03_LANG
typedef typename _Sp<_Tp, _Args...>::template rebind<_Up> type;
#else
typedef typename _Sp<_Tp, _Args...>::template rebind<_Up>::other type;
@@ -858,7 +858,7 @@ struct __pointer_traits_rebind<_Sp<_Tp, _Args...>, _Up, false>
template <template <class> class _Sp, class _Tp, class _Up>
struct __pointer_traits_rebind<_Sp<_Tp>, _Up, true>
{
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#ifndef _LIBCPP_CXX03_LANG
typedef typename _Sp<_Tp>::template rebind<_Up> type;
#else
typedef typename _Sp<_Tp>::template rebind<_Up>::other type;
@@ -874,7 +874,7 @@ struct __pointer_traits_rebind<_Sp<_Tp>, _Up, false>
template <template <class, class> class _Sp, class _Tp, class _A0, class _Up>
struct __pointer_traits_rebind<_Sp<_Tp, _A0>, _Up, true>
{
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#ifndef _LIBCPP_CXX03_LANG
typedef typename _Sp<_Tp, _A0>::template rebind<_Up> type;
#else
typedef typename _Sp<_Tp, _A0>::template rebind<_Up>::other type;
@@ -891,7 +891,7 @@ template <template <class, class, class> class _Sp, class _Tp, class _A0,
class _A1, class _Up>
struct __pointer_traits_rebind<_Sp<_Tp, _A0, _A1>, _Up, true>
{
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#ifndef _LIBCPP_CXX03_LANG
typedef typename _Sp<_Tp, _A0, _A1>::template rebind<_Up> type;
#else
typedef typename _Sp<_Tp, _A0, _A1>::template rebind<_Up>::other type;
@@ -909,7 +909,7 @@ template <template <class, class, class, class> class _Sp, class _Tp, class _A0,
class _A1, class _A2, class _Up>
struct __pointer_traits_rebind<_Sp<_Tp, _A0, _A1, _A2>, _Up, true>
{
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#ifndef _LIBCPP_CXX03_LANG
typedef typename _Sp<_Tp, _A0, _A1, _A2>::template rebind<_Up> type;
#else
typedef typename _Sp<_Tp, _A0, _A1, _A2>::template rebind<_Up>::other type;
@@ -932,12 +932,12 @@ struct _LIBCPP_TYPE_VIS_ONLY pointer_traits
typedef typename __pointer_traits_element_type<pointer>::type element_type;
typedef typename __pointer_traits_difference_type<pointer>::type difference_type;
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#ifndef _LIBCPP_CXX03_LANG
template <class _Up> using rebind = typename __pointer_traits_rebind<pointer, _Up>::type;
#else
template <class _Up> struct rebind
{typedef typename __pointer_traits_rebind<pointer, _Up>::type other;};
-#endif // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#endif // _LIBCPP_CXX03_LANG
private:
struct __nat {};
@@ -955,7 +955,7 @@ struct _LIBCPP_TYPE_VIS_ONLY pointer_traits<_Tp*>
typedef _Tp element_type;
typedef ptrdiff_t difference_type;
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#ifndef _LIBCPP_CXX03_LANG
template <class _Up> using rebind = _Up*;
#else
template <class _Up> struct rebind {typedef _Up* other;};
@@ -972,7 +972,7 @@ public:
template <class _From, class _To>
struct __rebind_pointer {
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#ifndef _LIBCPP_CXX03_LANG
typedef typename pointer_traits<_From>::template rebind<_To> type;
#else
typedef typename pointer_traits<_From>::template rebind<_To>::other type;
@@ -1036,7 +1036,7 @@ struct __const_pointer
template <class _Tp, class _Ptr, class _Alloc>
struct __const_pointer<_Tp, _Ptr, _Alloc, false>
{
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#ifndef _LIBCPP_CXX03_LANG
typedef typename pointer_traits<_Ptr>::template rebind<const _Tp> type;
#else
typedef typename pointer_traits<_Ptr>::template rebind<const _Tp>::other type;
@@ -1063,7 +1063,7 @@ struct __void_pointer
template <class _Ptr, class _Alloc>
struct __void_pointer<_Ptr, _Alloc, false>
{
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#ifndef _LIBCPP_CXX03_LANG
typedef typename pointer_traits<_Ptr>::template rebind<void> type;
#else
typedef typename pointer_traits<_Ptr>::template rebind<void>::other type;
@@ -1090,7 +1090,7 @@ struct __const_void_pointer
template <class _Ptr, class _Alloc>
struct __const_void_pointer<_Ptr, _Alloc, false>
{
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#ifndef _LIBCPP_CXX03_LANG
typedef typename pointer_traits<_Ptr>::template rebind<const void> type;
#else
typedef typename pointer_traits<_Ptr>::template rebind<const void>::other type;
@@ -1321,7 +1321,7 @@ struct __allocator_traits_rebind<_Alloc<_Tp, _A0, _A1, _A2>, _Up, false>
#endif // _LIBCPP_HAS_NO_VARIADICS
-#ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE
+#ifndef _LIBCPP_CXX03_LANG
template <class _Alloc, class _SizeType, class _ConstVoidPtr>
auto
@@ -1344,7 +1344,7 @@ struct __has_allocate_hint
{
};
-#else // _LIBCPP_HAS_NO_ADVANCED_SFINAE
+#else // _LIBCPP_CXX03_LANG
template <class _Alloc, class _SizeType, class _ConstVoidPtr>
struct __has_allocate_hint
@@ -1352,9 +1352,9 @@ struct __has_allocate_hint
{
};
-#endif // _LIBCPP_HAS_NO_ADVANCED_SFINAE
+#endif // _LIBCPP_CXX03_LANG
-#if !defined(_LIBCPP_HAS_NO_ADVANCED_SFINAE) && !defined(_LIBCPP_HAS_NO_VARIADICS)
+#if !defined(_LIBCPP_CXX03_LANG)
template <class _Alloc, class _Tp, class ..._Args>
decltype(_VSTD::declval<_Alloc>().construct(_VSTD::declval<_Tp*>(),
@@ -1435,7 +1435,7 @@ struct __has_select_on_container_copy_construction
{
};
-#else // _LIBCPP_HAS_NO_ADVANCED_SFINAE
+#else // _LIBCPP_CXX03_LANG
#ifndef _LIBCPP_HAS_NO_VARIADICS
@@ -1473,7 +1473,7 @@ struct __has_select_on_container_copy_construction
{
};
-#endif // _LIBCPP_HAS_NO_ADVANCED_SFINAE
+#endif // _LIBCPP_CXX03_LANG
template <class _Alloc, class _Ptr, bool = __has_difference_type<_Alloc>::value>
struct __alloc_traits_difference_type
@@ -1510,16 +1510,16 @@ struct _LIBCPP_TYPE_VIS_ONLY allocator_traits
typedef typename __is_always_equal<allocator_type>::type
is_always_equal;
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#ifndef _LIBCPP_CXX03_LANG
template <class _Tp> using rebind_alloc =
typename __allocator_traits_rebind<allocator_type, _Tp>::type;
template <class _Tp> using rebind_traits = allocator_traits<rebind_alloc<_Tp>>;
-#else // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#else // _LIBCPP_CXX03_LANG
template <class _Tp> struct rebind_alloc
{typedef typename __allocator_traits_rebind<allocator_type, _Tp>::type other;};
template <class _Tp> struct rebind_traits
{typedef allocator_traits<typename rebind_alloc<_Tp>::other> other;};
-#endif // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
static pointer allocate(allocator_type& __a, size_type __n)
@@ -1731,7 +1731,7 @@ private:
template <class _Traits, class _Tp>
struct __rebind_alloc_helper
{
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#ifndef _LIBCPP_CXX03_LANG
typedef typename _Traits::template rebind_alloc<_Tp> type;
#else
typedef typename _Traits::template rebind_alloc<_Tp>::other type;
diff --git a/include/ratio b/include/ratio
index 8f708ce47..08eb774df 100644
--- a/include/ratio
+++ b/include/ratio
@@ -300,18 +300,18 @@ public:
>::type type;
};
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#ifndef _LIBCPP_CXX03_LANG
template <class _R1, class _R2> using ratio_multiply
= typename __ratio_multiply<_R1, _R2>::type;
-#else // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#else // _LIBCPP_CXX03_LANG
template <class _R1, class _R2>
struct _LIBCPP_TYPE_VIS_ONLY ratio_multiply
: public __ratio_multiply<_R1, _R2>::type {};
-#endif // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#endif // _LIBCPP_CXX03_LANG
template <class _R1, class _R2>
struct __ratio_divide
@@ -327,18 +327,18 @@ public:
>::type type;
};
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#ifndef _LIBCPP_CXX03_LANG
template <class _R1, class _R2> using ratio_divide
= typename __ratio_divide<_R1, _R2>::type;
-#else // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#else // _LIBCPP_CXX03_LANG
template <class _R1, class _R2>
struct _LIBCPP_TYPE_VIS_ONLY ratio_divide
: public __ratio_divide<_R1, _R2>::type {};
-#endif // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#endif // _LIBCPP_CXX03_LANG
template <class _R1, class _R2>
struct __ratio_add
@@ -362,18 +362,18 @@ public:
>::type type;
};
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#ifndef _LIBCPP_CXX03_LANG
template <class _R1, class _R2> using ratio_add
= typename __ratio_add<_R1, _R2>::type;
-#else // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#else // _LIBCPP_CXX03_LANG
template <class _R1, class _R2>
struct _LIBCPP_TYPE_VIS_ONLY ratio_add
: public __ratio_add<_R1, _R2>::type {};
-#endif // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#endif // _LIBCPP_CXX03_LANG
template <class _R1, class _R2>
struct __ratio_subtract
@@ -397,18 +397,18 @@ public:
>::type type;
};
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#ifndef _LIBCPP_CXX03_LANG
template <class _R1, class _R2> using ratio_subtract
= typename __ratio_subtract<_R1, _R2>::type;
-#else // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#else // _LIBCPP_CXX03_LANG
template <class _R1, class _R2>
struct _LIBCPP_TYPE_VIS_ONLY ratio_subtract
: public __ratio_subtract<_R1, _R2>::type {};
-#endif // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#endif // _LIBCPP_CXX03_LANG
// ratio_equal
diff --git a/include/scoped_allocator b/include/scoped_allocator
index 9436dac9c..04e738645 100644
--- a/include/scoped_allocator
+++ b/include/scoped_allocator
@@ -115,7 +115,7 @@ template <class OuterA1, class OuterA2, class... InnerAllocs>
_LIBCPP_BEGIN_NAMESPACE_STD
-#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_ADVANCED_SFINAE)
+#if !defined(_LIBCPP_CXX03_LANG)
// scoped_allocator_adaptor
@@ -597,7 +597,7 @@ operator!=(const scoped_allocator_adaptor<_OuterA1, _InnerAllocs...>& __a,
return !(__a == __b);
}
-#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_ADVANCED_SFINAE)
+#endif // !defined(_LIBCPP_CXX03_LANG)
_LIBCPP_END_NAMESPACE_STD
diff --git a/include/type_traits b/include/type_traits
index 0d578bbe0..c777f451e 100644
--- a/include/type_traits
+++ b/include/type_traits
@@ -4351,7 +4351,7 @@ template <class _Tp> struct __is_nothrow_swappable;
template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
-#ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE
+#ifndef _LIBCPP_CXX03_LANG
typename enable_if
<
is_move_constructible<_Tp>::value &&
@@ -4559,7 +4559,7 @@ inline _LIBCPP_INLINE_VISIBILITY
typename __sfinae_underlying_type<_Tp>::__promoted_type
__convert_to_integral(_Tp __val) { return __val; }
-#ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE
+#ifndef _LIBCPP_CXX03_LANG
template <class _Tp>
struct __has_operator_addressof_member_imp
@@ -4591,7 +4591,7 @@ struct __has_operator_addressof
|| __has_operator_addressof_free_imp<_Tp>::value>
{};
-#endif // _LIBCPP_HAS_NO_ADVANCED_SFINAE
+#endif // _LIBCPP_CXX03_LANG
#if _LIBCPP_STD_VER > 14
template <class...> using void_t = void;