diff --git a/libcxx/docs/Cxx2aStatus.rst b/libcxx/docs/Cxx2aStatus.rst --- a/libcxx/docs/Cxx2aStatus.rst +++ b/libcxx/docs/Cxx2aStatus.rst @@ -43,7 +43,7 @@ .. [#note-P0600] P0600: The missing bits in P0600 are in |sect|\ [mem.res.class], |sect|\ [mem.poly.allocator.class], and |sect|\ [container.node.overview]. .. [#note-P0966] P0966: It was previously erroneously marked as complete in version 8.0. See `bug 45368 `__. - .. [#note-P0619] P0619: Only sections D.9 and D.10 are implemented. Section D.8 is partly implemented. Sections D.4, D.7, D.11, D.12, and D.14 remain undone. + .. [#note-P0619] P0619: Only sections D.8, D.9, and D.10 are implemented. Sections D.4, D.7, D.11, D.12, and D.14 remain undone. .. _issues-status-cxx2a: diff --git a/libcxx/docs/UsingLibcxx.rst b/libcxx/docs/UsingLibcxx.rst --- a/libcxx/docs/UsingLibcxx.rst +++ b/libcxx/docs/UsingLibcxx.rst @@ -256,6 +256,11 @@ It also re-enables the library-provided explicit specializations of `allocator` and `allocator`. +**_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS**: + This macro is used to re-enable the `argument_type`, `result_type`, + `first_argument_type`, and `second_argument_type` members of class + templates such as `plus` and `logical_not`. + **_LIBCPP_ENABLE_CXX20_REMOVED_NEGATORS**: This macro is used to re-enable `not1`, `not2`, `unary_negate`, and `binary_negate`. diff --git a/libcxx/include/__config b/libcxx/include/__config --- a/libcxx/include/__config +++ b/libcxx/include/__config @@ -94,6 +94,9 @@ # define _LIBCPP_ABI_BAD_FUNCTION_CALL_KEY_FUNCTION // Enable optimized version of __do_get_(un)signed which avoids redundant copies. # define _LIBCPP_ABI_OPTIMIZED_LOCALE_NUM_GET +// In C++20 and later, don't derive std::plus from std::binary_function, +// nor std::negate from std::unary_function. +# define _LIBCPP_ABI_NO_BINDER_BASES // Give reverse_iterator one data member of type T, not two. // Also, in C++17 and later, don't derive iterator types from std::iterator. # define _LIBCPP_ABI_NO_ITERATOR_BASES @@ -1360,6 +1363,7 @@ #if defined(_LIBCPP_ENABLE_CXX20_REMOVED_FEATURES) #define _LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS +#define _LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS #define _LIBCPP_ENABLE_CXX20_REMOVED_NEGATORS #define _LIBCPP_ENABLE_CXX20_REMOVED_RAW_STORAGE_ITERATOR #endif // _LIBCPP_ENABLE_CXX20_REMOVED_FEATURES diff --git a/libcxx/include/__functional_base b/libcxx/include/__functional_base --- a/libcxx/include/__functional_base +++ b/libcxx/include/__functional_base @@ -42,14 +42,24 @@ static const bool value = sizeof(__test<_Tp>(0)) == 1; }; +_LIBCPP_SUPPRESS_DEPRECATED_PUSH #if _LIBCPP_STD_VER > 11 template #else template #endif -struct _LIBCPP_TEMPLATE_VIS less : binary_function<_Tp, _Tp, bool> +struct _LIBCPP_TEMPLATE_VIS less +#if !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : binary_function<_Tp, _Tp, bool> +#endif { +_LIBCPP_SUPPRESS_DEPRECATED_POP typedef bool __result_type; // used by valarray +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef bool result_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp first_argument_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp second_argument_type; +#endif _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY bool operator()(const _Tp& __x, const _Tp& __y) const {return __x < __y;} @@ -373,7 +383,9 @@ template class _LIBCPP_TEMPLATE_VIS reference_wrapper +#if _LIBCPP_STD_VER <= 17 || !defined(_LIBCPP_ABI_NO_BINDER_BASES) : public __weak_result_type<_Tp> +#endif { public: // types diff --git a/libcxx/include/functional b/libcxx/include/functional --- a/libcxx/include/functional +++ b/libcxx/include/functional @@ -76,116 +76,97 @@ template using unwrap_ref_decay_t = typename unwrap_ref_decay::type; // since C++20 template // in C++14 -struct plus : binary_function -{ +struct plus { T operator()(const T& x, const T& y) const; }; template // in C++14 -struct minus : binary_function -{ +struct minus { T operator()(const T& x, const T& y) const; }; template // in C++14 -struct multiplies : binary_function -{ +struct multiplies { T operator()(const T& x, const T& y) const; }; template // in C++14 -struct divides : binary_function -{ +struct divides { T operator()(const T& x, const T& y) const; }; template // in C++14 -struct modulus : binary_function -{ +struct modulus { T operator()(const T& x, const T& y) const; }; template // in C++14 -struct negate : unary_function -{ +struct negate { T operator()(const T& x) const; }; template // in C++14 -struct equal_to : binary_function -{ +struct equal_to { bool operator()(const T& x, const T& y) const; }; template // in C++14 -struct not_equal_to : binary_function -{ +struct not_equal_to { bool operator()(const T& x, const T& y) const; }; template // in C++14 -struct greater : binary_function -{ +struct greater { bool operator()(const T& x, const T& y) const; }; template // in C++14 -struct less : binary_function -{ +struct less { bool operator()(const T& x, const T& y) const; }; template // in C++14 -struct greater_equal : binary_function -{ +struct greater_equal { bool operator()(const T& x, const T& y) const; }; template // in C++14 -struct less_equal : binary_function -{ +struct less_equal { bool operator()(const T& x, const T& y) const; }; template // in C++14 -struct logical_and : binary_function -{ +struct logical_and { bool operator()(const T& x, const T& y) const; }; template // in C++14 -struct logical_or : binary_function -{ +struct logical_or { bool operator()(const T& x, const T& y) const; }; template // in C++14 -struct logical_not : unary_function -{ +struct logical_not { bool operator()(const T& x) const; }; template // in C++14 -struct bit_and : binary_function -{ +struct bit_and { T operator()(const T& x, const T& y) const; }; template // in C++14 -struct bit_or : binary_function -{ +struct bit_or { T operator()(const T& x, const T& y) const; }; template // in C++14 -struct bit_xor : binary_function -{ +struct bit_xor { T operator()(const T& x, const T& y) const; }; template // C++14 -struct bit_not : unary_function -{ +struct bit_not { T operator()(const T& x) const; }; @@ -524,14 +505,24 @@ _LIBCPP_BEGIN_NAMESPACE_STD +_LIBCPP_SUPPRESS_DEPRECATED_PUSH #if _LIBCPP_STD_VER > 11 template #else template #endif -struct _LIBCPP_TEMPLATE_VIS plus : binary_function<_Tp, _Tp, _Tp> +struct _LIBCPP_TEMPLATE_VIS plus +#if !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : binary_function<_Tp, _Tp, _Tp> +#endif { +_LIBCPP_SUPPRESS_DEPRECATED_POP typedef _Tp __result_type; // used by valarray +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp result_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp first_argument_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp second_argument_type; +#endif _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x, const _Tp& __y) const {return __x + __y;} @@ -552,14 +543,24 @@ #endif +_LIBCPP_SUPPRESS_DEPRECATED_PUSH #if _LIBCPP_STD_VER > 11 template #else template #endif -struct _LIBCPP_TEMPLATE_VIS minus : binary_function<_Tp, _Tp, _Tp> +struct _LIBCPP_TEMPLATE_VIS minus +#if !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : binary_function<_Tp, _Tp, _Tp> +#endif { +_LIBCPP_SUPPRESS_DEPRECATED_POP typedef _Tp __result_type; // used by valarray +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp result_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp first_argument_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp second_argument_type; +#endif _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x, const _Tp& __y) const {return __x - __y;} @@ -580,14 +581,24 @@ #endif +_LIBCPP_SUPPRESS_DEPRECATED_PUSH #if _LIBCPP_STD_VER > 11 template #else template #endif -struct _LIBCPP_TEMPLATE_VIS multiplies : binary_function<_Tp, _Tp, _Tp> +struct _LIBCPP_TEMPLATE_VIS multiplies +#if !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : binary_function<_Tp, _Tp, _Tp> +#endif { +_LIBCPP_SUPPRESS_DEPRECATED_POP typedef _Tp __result_type; // used by valarray +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp result_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp first_argument_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp second_argument_type; +#endif _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x, const _Tp& __y) const {return __x * __y;} @@ -608,14 +619,24 @@ #endif +_LIBCPP_SUPPRESS_DEPRECATED_PUSH #if _LIBCPP_STD_VER > 11 template #else template #endif -struct _LIBCPP_TEMPLATE_VIS divides : binary_function<_Tp, _Tp, _Tp> +struct _LIBCPP_TEMPLATE_VIS divides +#if !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : binary_function<_Tp, _Tp, _Tp> +#endif { +_LIBCPP_SUPPRESS_DEPRECATED_POP typedef _Tp __result_type; // used by valarray +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp result_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp first_argument_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp second_argument_type; +#endif _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x, const _Tp& __y) const {return __x / __y;} @@ -636,14 +657,24 @@ #endif +_LIBCPP_SUPPRESS_DEPRECATED_PUSH #if _LIBCPP_STD_VER > 11 template #else template #endif -struct _LIBCPP_TEMPLATE_VIS modulus : binary_function<_Tp, _Tp, _Tp> +struct _LIBCPP_TEMPLATE_VIS modulus +#if !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : binary_function<_Tp, _Tp, _Tp> +#endif { +_LIBCPP_SUPPRESS_DEPRECATED_POP typedef _Tp __result_type; // used by valarray +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp result_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp first_argument_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp second_argument_type; +#endif _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x, const _Tp& __y) const {return __x % __y;} @@ -664,14 +695,23 @@ #endif +_LIBCPP_SUPPRESS_DEPRECATED_PUSH #if _LIBCPP_STD_VER > 11 template #else template #endif -struct _LIBCPP_TEMPLATE_VIS negate : unary_function<_Tp, _Tp> +struct _LIBCPP_TEMPLATE_VIS negate +#if !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : unary_function<_Tp, _Tp> +#endif { +_LIBCPP_SUPPRESS_DEPRECATED_POP typedef _Tp __result_type; // used by valarray +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp result_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp argument_type; +#endif _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x) const {return -__x;} @@ -692,14 +732,24 @@ #endif +_LIBCPP_SUPPRESS_DEPRECATED_PUSH #if _LIBCPP_STD_VER > 11 template #else template #endif -struct _LIBCPP_TEMPLATE_VIS equal_to : binary_function<_Tp, _Tp, bool> +struct _LIBCPP_TEMPLATE_VIS equal_to +#if !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : binary_function<_Tp, _Tp, bool> +#endif { +_LIBCPP_SUPPRESS_DEPRECATED_POP typedef bool __result_type; // used by valarray +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef bool result_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp first_argument_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp second_argument_type; +#endif _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY bool operator()(const _Tp& __x, const _Tp& __y) const {return __x == __y;} @@ -720,14 +770,24 @@ #endif +_LIBCPP_SUPPRESS_DEPRECATED_PUSH #if _LIBCPP_STD_VER > 11 template #else template #endif -struct _LIBCPP_TEMPLATE_VIS not_equal_to : binary_function<_Tp, _Tp, bool> +struct _LIBCPP_TEMPLATE_VIS not_equal_to +#if !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : binary_function<_Tp, _Tp, bool> +#endif { +_LIBCPP_SUPPRESS_DEPRECATED_POP typedef bool __result_type; // used by valarray +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef bool result_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp first_argument_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp second_argument_type; +#endif _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY bool operator()(const _Tp& __x, const _Tp& __y) const {return __x != __y;} @@ -748,14 +808,24 @@ #endif +_LIBCPP_SUPPRESS_DEPRECATED_PUSH #if _LIBCPP_STD_VER > 11 template #else template #endif -struct _LIBCPP_TEMPLATE_VIS greater : binary_function<_Tp, _Tp, bool> +struct _LIBCPP_TEMPLATE_VIS greater +#if !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : binary_function<_Tp, _Tp, bool> +#endif { +_LIBCPP_SUPPRESS_DEPRECATED_POP typedef bool __result_type; // used by valarray +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef bool result_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp first_argument_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp second_argument_type; +#endif _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY bool operator()(const _Tp& __x, const _Tp& __y) const {return __x > __y;} @@ -778,14 +848,25 @@ // less in <__functional_base> + +_LIBCPP_SUPPRESS_DEPRECATED_PUSH #if _LIBCPP_STD_VER > 11 template #else template #endif -struct _LIBCPP_TEMPLATE_VIS greater_equal : binary_function<_Tp, _Tp, bool> +struct _LIBCPP_TEMPLATE_VIS greater_equal +#if !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : binary_function<_Tp, _Tp, bool> +#endif { +_LIBCPP_SUPPRESS_DEPRECATED_POP typedef bool __result_type; // used by valarray +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef bool result_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp first_argument_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp second_argument_type; +#endif _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY bool operator()(const _Tp& __x, const _Tp& __y) const {return __x >= __y;} @@ -806,14 +887,24 @@ #endif +_LIBCPP_SUPPRESS_DEPRECATED_PUSH #if _LIBCPP_STD_VER > 11 template #else template #endif -struct _LIBCPP_TEMPLATE_VIS less_equal : binary_function<_Tp, _Tp, bool> +struct _LIBCPP_TEMPLATE_VIS less_equal +#if !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : binary_function<_Tp, _Tp, bool> +#endif { +_LIBCPP_SUPPRESS_DEPRECATED_POP typedef bool __result_type; // used by valarray +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef bool result_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp first_argument_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp second_argument_type; +#endif _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY bool operator()(const _Tp& __x, const _Tp& __y) const {return __x <= __y;} @@ -834,14 +925,24 @@ #endif +_LIBCPP_SUPPRESS_DEPRECATED_PUSH #if _LIBCPP_STD_VER > 11 template #else template #endif -struct _LIBCPP_TEMPLATE_VIS logical_and : binary_function<_Tp, _Tp, bool> +struct _LIBCPP_TEMPLATE_VIS logical_and +#if !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : binary_function<_Tp, _Tp, bool> +#endif { +_LIBCPP_SUPPRESS_DEPRECATED_POP typedef bool __result_type; // used by valarray +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef bool result_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp first_argument_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp second_argument_type; +#endif _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY bool operator()(const _Tp& __x, const _Tp& __y) const {return __x && __y;} @@ -862,14 +963,24 @@ #endif +_LIBCPP_SUPPRESS_DEPRECATED_PUSH #if _LIBCPP_STD_VER > 11 template #else template #endif -struct _LIBCPP_TEMPLATE_VIS logical_or : binary_function<_Tp, _Tp, bool> +struct _LIBCPP_TEMPLATE_VIS logical_or +#if !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : binary_function<_Tp, _Tp, bool> +#endif { +_LIBCPP_SUPPRESS_DEPRECATED_POP typedef bool __result_type; // used by valarray +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef bool result_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp first_argument_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp second_argument_type; +#endif _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY bool operator()(const _Tp& __x, const _Tp& __y) const {return __x || __y;} @@ -890,14 +1001,23 @@ #endif +_LIBCPP_SUPPRESS_DEPRECATED_PUSH #if _LIBCPP_STD_VER > 11 template #else template #endif -struct _LIBCPP_TEMPLATE_VIS logical_not : unary_function<_Tp, bool> +struct _LIBCPP_TEMPLATE_VIS logical_not +#if !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : unary_function<_Tp, bool> +#endif { +_LIBCPP_SUPPRESS_DEPRECATED_POP typedef bool __result_type; // used by valarray +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef bool result_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp argument_type; +#endif _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY bool operator()(const _Tp& __x) const {return !__x;} @@ -918,14 +1038,24 @@ #endif +_LIBCPP_SUPPRESS_DEPRECATED_PUSH #if _LIBCPP_STD_VER > 11 template #else template #endif -struct _LIBCPP_TEMPLATE_VIS bit_and : binary_function<_Tp, _Tp, _Tp> +struct _LIBCPP_TEMPLATE_VIS bit_and +#if !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : binary_function<_Tp, _Tp, _Tp> +#endif { +_LIBCPP_SUPPRESS_DEPRECATED_POP typedef _Tp __result_type; // used by valarray +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp result_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp first_argument_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp second_argument_type; +#endif _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x, const _Tp& __y) const {return __x & __y;} @@ -946,14 +1076,24 @@ #endif +_LIBCPP_SUPPRESS_DEPRECATED_PUSH #if _LIBCPP_STD_VER > 11 template #else template #endif -struct _LIBCPP_TEMPLATE_VIS bit_or : binary_function<_Tp, _Tp, _Tp> +struct _LIBCPP_TEMPLATE_VIS bit_or +#if !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : binary_function<_Tp, _Tp, _Tp> +#endif { +_LIBCPP_SUPPRESS_DEPRECATED_POP typedef _Tp __result_type; // used by valarray +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp result_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp first_argument_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp second_argument_type; +#endif _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x, const _Tp& __y) const {return __x | __y;} @@ -974,14 +1114,24 @@ #endif +_LIBCPP_SUPPRESS_DEPRECATED_PUSH #if _LIBCPP_STD_VER > 11 template #else template #endif -struct _LIBCPP_TEMPLATE_VIS bit_xor : binary_function<_Tp, _Tp, _Tp> +struct _LIBCPP_TEMPLATE_VIS bit_xor +#if !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : binary_function<_Tp, _Tp, _Tp> +#endif { +_LIBCPP_SUPPRESS_DEPRECATED_POP typedef _Tp __result_type; // used by valarray +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp result_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp first_argument_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp second_argument_type; +#endif _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x, const _Tp& __y) const {return __x ^ __y;} @@ -1003,9 +1153,18 @@ #if _LIBCPP_STD_VER > 11 +_LIBCPP_SUPPRESS_DEPRECATED_PUSH template -struct _LIBCPP_TEMPLATE_VIS bit_not : unary_function<_Tp, _Tp> +struct _LIBCPP_TEMPLATE_VIS bit_not +#if !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : unary_function<_Tp, _Tp> +#endif { +_LIBCPP_SUPPRESS_DEPRECATED_POP +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp result_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp argument_type; +#endif _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x) const {return ~__x;} @@ -1307,7 +1466,9 @@ template class __mem_fn +#if _LIBCPP_STD_VER <= 17 || !defined(_LIBCPP_ABI_NO_BINDER_BASES) : public __weak_result_type<_Tp> +#endif { public: // types @@ -2354,8 +2515,10 @@ template class _LIBCPP_TEMPLATE_VIS function<_Rp(_ArgTypes...)> +#if _LIBCPP_STD_VER <= 17 || !defined(_LIBCPP_ABI_NO_BINDER_BASES) : public __function::__maybe_derive_from_unary_function<_Rp(_ArgTypes...)>, public __function::__maybe_derive_from_binary_function<_Rp(_ArgTypes...)> +#endif { #ifndef _LIBCPP_ABI_OPTIMIZED_FUNCTION typedef __function::__value_func<_Rp(_ArgTypes...)> __func; @@ -2884,7 +3047,9 @@ template class __bind +#if _LIBCPP_STD_VER <= 17 || !defined(_LIBCPP_ABI_NO_BINDER_BASES) : public __weak_result_type::type> +#endif { protected: typedef typename decay<_Fp>::type _Fd; diff --git a/libcxx/test/libcxx/utilities/function.objects/refwrap/binary.pass.cpp b/libcxx/test/libcxx/utilities/function.objects/refwrap/binary.pass.cpp --- a/libcxx/test/libcxx/utilities/function.objects/refwrap/binary.pass.cpp +++ b/libcxx/test/libcxx/utilities/function.objects/refwrap/binary.pass.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +// REQUIRES: c++03 || c++11 || c++14 || c++17 + // // reference_wrapper diff --git a/libcxx/test/libcxx/utilities/function.objects/refwrap/unary.pass.cpp b/libcxx/test/libcxx/utilities/function.objects/refwrap/unary.pass.cpp --- a/libcxx/test/libcxx/utilities/function.objects/refwrap/unary.pass.cpp +++ b/libcxx/test/libcxx/utilities/function.objects/refwrap/unary.pass.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +// REQUIRES: c++03 || c++11 || c++14 || c++17 + // // reference_wrapper diff --git a/libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.next/check_round_trip.h b/libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.next/check_round_trip.h --- a/libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.next/check_round_trip.h +++ b/libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.next/check_round_trip.h @@ -20,7 +20,7 @@ template constexpr void check_round_trip(stride_counting_iterator const& i, std::ptrdiff_t const n) { assert(i.stride_count() <= 1); - assert(i.stride_displacement() == n < 0 ? -1 : 1); + assert(i.stride_displacement() == (n < 0 ? -1 : 1)); } template diff --git a/libcxx/test/std/iterators/iterator.requirements/iterator.concepts/iterator.concept.random.access/contiguous_iterator.compile.pass.cpp b/libcxx/test/std/iterators/iterator.requirements/iterator.concepts/iterator.concept.random.access/contiguous_iterator.compile.pass.cpp --- a/libcxx/test/std/iterators/iterator.requirements/iterator.concepts/iterator.concept.random.access/contiguous_iterator.compile.pass.cpp +++ b/libcxx/test/std/iterators/iterator.requirements/iterator.concepts/iterator.concept.random.access/contiguous_iterator.compile.pass.cpp @@ -14,6 +14,7 @@ // concept contiguous_iterator; #include +#include #include "test_iterators.h" @@ -42,11 +43,7 @@ reference operator*() const; pointer operator->() const; - friend bool operator==(const self&, const self& y); - friend bool operator< (const self&, const self& y); - friend bool operator<=(const self&, const self& y); - friend bool operator> (const self&, const self& y); - friend bool operator>=(const self&, const self& y); + bool operator<=>(const self&) const = default; self& operator++(); self operator++(int); @@ -80,11 +77,7 @@ reference operator*() const; pointer operator->() const; - friend bool operator==(const self&, const self& y); - friend bool operator< (const self&, const self& y); - friend bool operator<=(const self&, const self& y); - friend bool operator> (const self&, const self& y); - friend bool operator>=(const self&, const self& y); + bool operator<=>(const self&) const = default; self& operator++(); self operator++(int); @@ -118,11 +111,7 @@ reference operator*() const; pointer operator->() const; - friend bool operator==(const self&, const self& y); - friend bool operator< (const self&, const self& y); - friend bool operator<=(const self&, const self& y); - friend bool operator> (const self&, const self& y); - friend bool operator>=(const self&, const self& y); + bool operator<=>(const self&) const = default; self& operator++(); self operator++(int); @@ -156,11 +145,7 @@ reference operator*() const; pointer operator->() const; - friend bool operator==(const self&, const self& y); - friend bool operator< (const self&, const self& y); - friend bool operator<=(const self&, const self& y); - friend bool operator> (const self&, const self& y); - friend bool operator>=(const self&, const self& y); + bool operator<=>(const self&) const = default; self& operator++(); self operator++(int); @@ -195,11 +180,7 @@ reference operator*() const; pointer operator->() const; - friend bool operator==(const self&, const self& y); - friend bool operator< (const self&, const self& y); - friend bool operator<=(const self&, const self& y); - friend bool operator> (const self&, const self& y); - friend bool operator>=(const self&, const self& y); + bool operator<=>(const self&) const = default; self& operator++(); self operator++(int); @@ -240,11 +221,7 @@ reference operator*() const; pointer operator->() const; - friend bool operator==(const self&, const self& y); - friend bool operator< (const self&, const self& y); - friend bool operator<=(const self&, const self& y); - friend bool operator> (const self&, const self& y); - friend bool operator>=(const self&, const self& y); + bool operator<=>(const self&) const = default; self& operator++(); self operator++(int); @@ -254,7 +231,7 @@ self& operator+=(difference_type n); self operator+(difference_type n) const; - friend self operator+(difference_type n, self x); + friend self operator+(difference_type n, self x) { return self{}; } self& operator-=(difference_type n); self operator-(difference_type n) const; diff --git a/libcxx/test/std/utilities/function.objects/arithmetic.operations/divides.pass.cpp b/libcxx/test/std/utilities/function.objects/arithmetic.operations/divides.pass.cpp --- a/libcxx/test/std/utilities/function.objects/arithmetic.operations/divides.pass.cpp +++ b/libcxx/test/std/utilities/function.objects/arithmetic.operations/divides.pass.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS + // // divides @@ -20,9 +22,11 @@ { typedef std::divides F; const F f = F(); +#if TEST_STD_VER <= 17 static_assert((std::is_same::value), "" ); static_assert((std::is_same::value), "" ); static_assert((std::is_same::value), "" ); +#endif assert(f(36, 4) == 9); #if TEST_STD_VER > 11 typedef std::divides<> F2; diff --git a/libcxx/test/std/utilities/function.objects/arithmetic.operations/minus.pass.cpp b/libcxx/test/std/utilities/function.objects/arithmetic.operations/minus.pass.cpp --- a/libcxx/test/std/utilities/function.objects/arithmetic.operations/minus.pass.cpp +++ b/libcxx/test/std/utilities/function.objects/arithmetic.operations/minus.pass.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS + // // minus @@ -20,9 +22,11 @@ { typedef std::minus F; const F f = F(); +#if TEST_STD_VER <= 17 static_assert((std::is_same::value), "" ); static_assert((std::is_same::value), "" ); static_assert((std::is_same::value), "" ); +#endif assert(f(3, 2) == 1); #if TEST_STD_VER > 11 typedef std::minus<> F2; diff --git a/libcxx/test/std/utilities/function.objects/arithmetic.operations/modulus.pass.cpp b/libcxx/test/std/utilities/function.objects/arithmetic.operations/modulus.pass.cpp --- a/libcxx/test/std/utilities/function.objects/arithmetic.operations/modulus.pass.cpp +++ b/libcxx/test/std/utilities/function.objects/arithmetic.operations/modulus.pass.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS + // // modulus @@ -20,9 +22,11 @@ { typedef std::modulus F; const F f = F(); +#if TEST_STD_VER <= 17 static_assert((std::is_same::value), "" ); static_assert((std::is_same::value), "" ); static_assert((std::is_same::value), "" ); +#endif assert(f(36, 8) == 4); #if TEST_STD_VER > 11 typedef std::modulus<> F2; diff --git a/libcxx/test/std/utilities/function.objects/arithmetic.operations/multiplies.pass.cpp b/libcxx/test/std/utilities/function.objects/arithmetic.operations/multiplies.pass.cpp --- a/libcxx/test/std/utilities/function.objects/arithmetic.operations/multiplies.pass.cpp +++ b/libcxx/test/std/utilities/function.objects/arithmetic.operations/multiplies.pass.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS + // // multiplies @@ -20,9 +22,11 @@ { typedef std::multiplies F; const F f = F(); +#if TEST_STD_VER <= 17 static_assert((std::is_same::value), "" ); static_assert((std::is_same::value), "" ); static_assert((std::is_same::value), "" ); +#endif assert(f(3, 2) == 6); #if TEST_STD_VER > 11 typedef std::multiplies<> F2; diff --git a/libcxx/test/std/utilities/function.objects/arithmetic.operations/negate.pass.cpp b/libcxx/test/std/utilities/function.objects/arithmetic.operations/negate.pass.cpp --- a/libcxx/test/std/utilities/function.objects/arithmetic.operations/negate.pass.cpp +++ b/libcxx/test/std/utilities/function.objects/arithmetic.operations/negate.pass.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS + // // negate @@ -20,8 +22,10 @@ { typedef std::negate F; const F f = F(); +#if TEST_STD_VER <= 17 static_assert((std::is_same::value), "" ); static_assert((std::is_same::value), "" ); +#endif assert(f(36) == -36); #if TEST_STD_VER > 11 typedef std::negate<> F2; diff --git a/libcxx/test/std/utilities/function.objects/arithmetic.operations/plus.pass.cpp b/libcxx/test/std/utilities/function.objects/arithmetic.operations/plus.pass.cpp --- a/libcxx/test/std/utilities/function.objects/arithmetic.operations/plus.pass.cpp +++ b/libcxx/test/std/utilities/function.objects/arithmetic.operations/plus.pass.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS + // // plus @@ -20,9 +22,11 @@ { typedef std::plus F; const F f = F(); - static_assert((std::is_same::value), "" ); - static_assert((std::is_same::value), "" ); - static_assert((std::is_same::value), "" ); +#if TEST_STD_VER <= 17 + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); +#endif assert(f(3, 2) == 5); #if TEST_STD_VER > 11 typedef std::plus<> F2; diff --git a/libcxx/test/std/utilities/function.objects/bitwise.operations/bit_and.pass.cpp b/libcxx/test/std/utilities/function.objects/bitwise.operations/bit_and.pass.cpp --- a/libcxx/test/std/utilities/function.objects/bitwise.operations/bit_and.pass.cpp +++ b/libcxx/test/std/utilities/function.objects/bitwise.operations/bit_and.pass.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS + // // bit_and @@ -20,9 +22,11 @@ { typedef std::bit_and F; const F f = F(); +#if TEST_STD_VER <= 17 static_assert((std::is_same::value), "" ); static_assert((std::is_same::value), "" ); static_assert((std::is_same::value), "" ); +#endif assert(f(0xEA95, 0xEA95) == 0xEA95); assert(f(0xEA95, 0x58D3) == 0x4891); assert(f(0x58D3, 0xEA95) == 0x4891); diff --git a/libcxx/test/std/utilities/function.objects/bitwise.operations/bit_not.pass.cpp b/libcxx/test/std/utilities/function.objects/bitwise.operations/bit_not.pass.cpp --- a/libcxx/test/std/utilities/function.objects/bitwise.operations/bit_not.pass.cpp +++ b/libcxx/test/std/utilities/function.objects/bitwise.operations/bit_not.pass.cpp @@ -7,6 +7,8 @@ //===----------------------------------------------------------------------===// // UNSUPPORTED: c++03, c++11 +// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS + // // bit_not @@ -21,8 +23,10 @@ { typedef std::bit_not F; const F f = F(); +#if TEST_STD_VER <= 17 static_assert((std::is_same::value), "" ); static_assert((std::is_same::value), "" ); +#endif assert((f(0xEA95) & 0xFFFF ) == 0x156A); assert((f(0x58D3) & 0xFFFF ) == 0xA72C); assert((f(0) & 0xFFFF ) == 0xFFFF); diff --git a/libcxx/test/std/utilities/function.objects/bitwise.operations/bit_or.pass.cpp b/libcxx/test/std/utilities/function.objects/bitwise.operations/bit_or.pass.cpp --- a/libcxx/test/std/utilities/function.objects/bitwise.operations/bit_or.pass.cpp +++ b/libcxx/test/std/utilities/function.objects/bitwise.operations/bit_or.pass.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS + // // bit_or @@ -20,9 +22,11 @@ { typedef std::bit_or F; const F f = F(); +#if TEST_STD_VER <= 17 static_assert((std::is_same::value), "" ); static_assert((std::is_same::value), "" ); static_assert((std::is_same::value), "" ); +#endif assert(f(0xEA95, 0xEA95) == 0xEA95); assert(f(0xEA95, 0x58D3) == 0xFAD7); assert(f(0x58D3, 0xEA95) == 0xFAD7); diff --git a/libcxx/test/std/utilities/function.objects/bitwise.operations/bit_xor.pass.cpp b/libcxx/test/std/utilities/function.objects/bitwise.operations/bit_xor.pass.cpp --- a/libcxx/test/std/utilities/function.objects/bitwise.operations/bit_xor.pass.cpp +++ b/libcxx/test/std/utilities/function.objects/bitwise.operations/bit_xor.pass.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS + // // bit_xor @@ -21,9 +23,11 @@ { typedef std::bit_xor F; const F f = F(); +#if TEST_STD_VER <= 17 static_assert((std::is_same::value), "" ); static_assert((std::is_same::value), "" ); static_assert((std::is_same::value), "" ); +#endif assert(f(0xEA95, 0xEA95) == 0); assert(f(0xEA95, 0x58D3) == 0xB246); assert(f(0x58D3, 0xEA95) == 0xB246); diff --git a/libcxx/test/std/utilities/function.objects/comparisons/equal_to.pass.cpp b/libcxx/test/std/utilities/function.objects/comparisons/equal_to.pass.cpp --- a/libcxx/test/std/utilities/function.objects/comparisons/equal_to.pass.cpp +++ b/libcxx/test/std/utilities/function.objects/comparisons/equal_to.pass.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS + // // equal_to @@ -20,9 +22,11 @@ { typedef std::equal_to F; const F f = F(); +#if TEST_STD_VER <= 17 static_assert((std::is_same::value), "" ); static_assert((std::is_same::value), "" ); static_assert((std::is_same::value), "" ); +#endif assert(f(36, 36)); assert(!f(36, 6)); #if TEST_STD_VER > 11 diff --git a/libcxx/test/std/utilities/function.objects/comparisons/greater.pass.cpp b/libcxx/test/std/utilities/function.objects/comparisons/greater.pass.cpp --- a/libcxx/test/std/utilities/function.objects/comparisons/greater.pass.cpp +++ b/libcxx/test/std/utilities/function.objects/comparisons/greater.pass.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS + // // greater @@ -21,9 +23,11 @@ { typedef std::greater F; const F f = F(); +#if TEST_STD_VER <= 17 static_assert((std::is_same::value), "" ); static_assert((std::is_same::value), "" ); static_assert((std::is_same::value), "" ); +#endif assert(!f(36, 36)); assert(f(36, 6)); assert(!f(6, 36)); diff --git a/libcxx/test/std/utilities/function.objects/comparisons/greater_equal.pass.cpp b/libcxx/test/std/utilities/function.objects/comparisons/greater_equal.pass.cpp --- a/libcxx/test/std/utilities/function.objects/comparisons/greater_equal.pass.cpp +++ b/libcxx/test/std/utilities/function.objects/comparisons/greater_equal.pass.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS + // // greater_equal @@ -21,9 +23,11 @@ { typedef std::greater_equal F; const F f = F(); +#if TEST_STD_VER <= 17 static_assert((std::is_same::value), "" ); static_assert((std::is_same::value), "" ); static_assert((std::is_same::value), "" ); +#endif assert(f(36, 36)); assert(f(36, 6)); assert(!f(6, 36)); diff --git a/libcxx/test/std/utilities/function.objects/comparisons/less.pass.cpp b/libcxx/test/std/utilities/function.objects/comparisons/less.pass.cpp --- a/libcxx/test/std/utilities/function.objects/comparisons/less.pass.cpp +++ b/libcxx/test/std/utilities/function.objects/comparisons/less.pass.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS + // // less @@ -21,9 +23,11 @@ { typedef std::less F; const F f = F(); +#if TEST_STD_VER <= 17 static_assert((std::is_same::value), "" ); static_assert((std::is_same::value), "" ); static_assert((std::is_same::value), "" ); +#endif assert(!f(36, 36)); assert(!f(36, 6)); assert(f(6, 36)); diff --git a/libcxx/test/std/utilities/function.objects/comparisons/less_equal.pass.cpp b/libcxx/test/std/utilities/function.objects/comparisons/less_equal.pass.cpp --- a/libcxx/test/std/utilities/function.objects/comparisons/less_equal.pass.cpp +++ b/libcxx/test/std/utilities/function.objects/comparisons/less_equal.pass.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS + // // less_equal @@ -21,9 +23,11 @@ { typedef std::less_equal F; const F f = F(); +#if TEST_STD_VER <= 17 static_assert((std::is_same::value), "" ); static_assert((std::is_same::value), "" ); static_assert((std::is_same::value), "" ); +#endif assert(f(36, 36)); assert(!f(36, 6)); assert(f(6, 36)); diff --git a/libcxx/test/std/utilities/function.objects/comparisons/not_equal_to.pass.cpp b/libcxx/test/std/utilities/function.objects/comparisons/not_equal_to.pass.cpp --- a/libcxx/test/std/utilities/function.objects/comparisons/not_equal_to.pass.cpp +++ b/libcxx/test/std/utilities/function.objects/comparisons/not_equal_to.pass.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS + // // not_equal_to @@ -20,9 +22,11 @@ { typedef std::not_equal_to F; const F f = F(); +#if TEST_STD_VER <= 17 static_assert((std::is_same::value), "" ); static_assert((std::is_same::value), "" ); static_assert((std::is_same::value), "" ); +#endif assert(!f(36, 36)); assert(f(36, 6)); #if TEST_STD_VER > 11 diff --git a/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/types.pass.cpp b/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/types.pass.cpp --- a/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/types.pass.cpp +++ b/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/types.pass.cpp @@ -70,7 +70,9 @@ template void test_nullary_function () { +#if TEST_STD_VER <= 17 static_assert((std::is_same::value), "" ); +#endif static_assert((!has_argument_type::value), "" ); static_assert((!has_first_argument_type::value), "" ); static_assert((!has_second_argument_type::value), "" ); @@ -79,8 +81,10 @@ template void test_unary_function () { +#if TEST_STD_VER <= 17 static_assert((std::is_same::value), "" ); static_assert((std::is_same::value), "" ); +#endif static_assert((!has_first_argument_type::value), "" ); static_assert((!has_second_argument_type::value), "" ); } @@ -88,16 +92,20 @@ template void test_binary_function () { +#if TEST_STD_VER <= 17 static_assert((std::is_same::value), "" ); static_assert((std::is_same::value), "" ); static_assert((std::is_same::value), "" ); +#endif static_assert((!has_argument_type::value), "" ); } template void test_other_function () { +#if TEST_STD_VER <= 17 static_assert((std::is_same::value), "" ); +#endif static_assert((!has_argument_type::value), "" ); static_assert((!has_first_argument_type::value), "" ); static_assert((!has_second_argument_type::value), "" ); diff --git a/libcxx/test/std/utilities/function.objects/logical.operations/logical_and.pass.cpp b/libcxx/test/std/utilities/function.objects/logical.operations/logical_and.pass.cpp --- a/libcxx/test/std/utilities/function.objects/logical.operations/logical_and.pass.cpp +++ b/libcxx/test/std/utilities/function.objects/logical.operations/logical_and.pass.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS + // // logical_and @@ -20,9 +22,11 @@ { typedef std::logical_and F; const F f = F(); +#if TEST_STD_VER <= 17 static_assert((std::is_same::value), "" ); static_assert((std::is_same::value), "" ); static_assert((std::is_same::value), "" ); +#endif assert(f(36, 36)); assert(!f(36, 0)); assert(!f(0, 36)); diff --git a/libcxx/test/std/utilities/function.objects/logical.operations/logical_not.pass.cpp b/libcxx/test/std/utilities/function.objects/logical.operations/logical_not.pass.cpp --- a/libcxx/test/std/utilities/function.objects/logical.operations/logical_not.pass.cpp +++ b/libcxx/test/std/utilities/function.objects/logical.operations/logical_not.pass.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS + // // logical_not @@ -20,8 +22,10 @@ { typedef std::logical_not F; const F f = F(); +#if TEST_STD_VER <= 17 static_assert((std::is_same::value), "" ); static_assert((std::is_same::value), "" ); +#endif assert(!f(36)); assert(f(0)); #if TEST_STD_VER > 11 diff --git a/libcxx/test/std/utilities/function.objects/logical.operations/logical_or.pass.cpp b/libcxx/test/std/utilities/function.objects/logical.operations/logical_or.pass.cpp --- a/libcxx/test/std/utilities/function.objects/logical.operations/logical_or.pass.cpp +++ b/libcxx/test/std/utilities/function.objects/logical.operations/logical_or.pass.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS + // // logical_or @@ -20,9 +22,11 @@ { typedef std::logical_or F; const F f = F(); +#if TEST_STD_VER <= 17 static_assert((std::is_same::value), "" ); static_assert((std::is_same::value), "" ); static_assert((std::is_same::value), "" ); +#endif assert(f(36, 36)); assert(f(36, 0)); assert(f(0, 36)); diff --git a/libcxx/test/std/utilities/function.objects/negators/binary_negate.pass.cpp b/libcxx/test/std/utilities/function.objects/negators/binary_negate.pass.cpp --- a/libcxx/test/std/utilities/function.objects/negators/binary_negate.pass.cpp +++ b/libcxx/test/std/utilities/function.objects/negators/binary_negate.pass.cpp @@ -10,6 +10,7 @@ // binary_negate +// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_CXX20_REMOVED_NEGATORS // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS diff --git a/libcxx/test/std/utilities/function.objects/negators/not1.pass.cpp b/libcxx/test/std/utilities/function.objects/negators/not1.pass.cpp --- a/libcxx/test/std/utilities/function.objects/negators/not1.pass.cpp +++ b/libcxx/test/std/utilities/function.objects/negators/not1.pass.cpp @@ -10,6 +10,7 @@ // not1 +// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_CXX20_REMOVED_NEGATORS // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS diff --git a/libcxx/test/std/utilities/function.objects/negators/not2.pass.cpp b/libcxx/test/std/utilities/function.objects/negators/not2.pass.cpp --- a/libcxx/test/std/utilities/function.objects/negators/not2.pass.cpp +++ b/libcxx/test/std/utilities/function.objects/negators/not2.pass.cpp @@ -10,6 +10,7 @@ // not2 +// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_CXX20_REMOVED_NEGATORS // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS diff --git a/libcxx/test/std/utilities/function.objects/negators/unary_negate.pass.cpp b/libcxx/test/std/utilities/function.objects/negators/unary_negate.pass.cpp --- a/libcxx/test/std/utilities/function.objects/negators/unary_negate.pass.cpp +++ b/libcxx/test/std/utilities/function.objects/negators/unary_negate.pass.cpp @@ -10,6 +10,7 @@ // unary_negate +// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_CXX20_REMOVED_NEGATORS // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS