diff --git a/libcxx/include/compare b/libcxx/include/compare --- a/libcxx/include/compare +++ b/libcxx/include/compare @@ -129,8 +129,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD -#if _LIBCPP_STD_VER > 17 - +#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_SPACESHIP_OPERATOR) // exposition only enum class _LIBCPP_ENUM_VIS _EqResult : unsigned char { __zero = 0, @@ -184,24 +183,19 @@ // comparisons _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator==(partial_ordering __v, _CmpUnspecifiedParam) noexcept; - _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator!=(partial_ordering __v, _CmpUnspecifiedParam) noexcept; _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator< (partial_ordering __v, _CmpUnspecifiedParam) noexcept; _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator<=(partial_ordering __v, _CmpUnspecifiedParam) noexcept; _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator> (partial_ordering __v, _CmpUnspecifiedParam) noexcept; _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator>=(partial_ordering __v, _CmpUnspecifiedParam) noexcept; - _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator==(_CmpUnspecifiedParam, partial_ordering __v) noexcept; - _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator!=(_CmpUnspecifiedParam, partial_ordering __v) noexcept; _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator< (_CmpUnspecifiedParam, partial_ordering __v) noexcept; _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator<=(_CmpUnspecifiedParam, partial_ordering __v) noexcept; _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator> (_CmpUnspecifiedParam, partial_ordering __v) noexcept; _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator>=(_CmpUnspecifiedParam, partial_ordering __v) noexcept; -#ifndef _LIBCPP_HAS_NO_SPACESHIP_OPERATOR _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator==(partial_ordering, partial_ordering) noexcept = default; _LIBCPP_INLINE_VISIBILITY friend constexpr partial_ordering operator<=>(partial_ordering __v, _CmpUnspecifiedParam) noexcept; _LIBCPP_INLINE_VISIBILITY friend constexpr partial_ordering operator<=>(_CmpUnspecifiedParam, partial_ordering __v) noexcept; -#endif private: _ValueT __value_; @@ -233,10 +227,6 @@ return __v.__is_ordered() && __v.__value_ >= 0; } -_LIBCPP_INLINE_VISIBILITY -constexpr bool operator==(_CmpUnspecifiedParam, partial_ordering __v) noexcept { - return __v.__is_ordered() && 0 == __v.__value_; -} _LIBCPP_INLINE_VISIBILITY constexpr bool operator< (_CmpUnspecifiedParam, partial_ordering __v) noexcept { return __v.__is_ordered() && 0 < __v.__value_; @@ -254,16 +244,6 @@ return __v.__is_ordered() && 0 >= __v.__value_; } -_LIBCPP_INLINE_VISIBILITY -constexpr bool operator!=(partial_ordering __v, _CmpUnspecifiedParam) noexcept { - return !__v.__is_ordered() || __v.__value_ != 0; -} -_LIBCPP_INLINE_VISIBILITY -constexpr bool operator!=(_CmpUnspecifiedParam, partial_ordering __v) noexcept { - return !__v.__is_ordered() || __v.__value_ != 0; -} - -#ifndef _LIBCPP_HAS_NO_SPACESHIP_OPERATOR _LIBCPP_INLINE_VISIBILITY constexpr partial_ordering operator<=>(partial_ordering __v, _CmpUnspecifiedParam) noexcept { return __v; @@ -272,7 +252,6 @@ constexpr partial_ordering operator<=>(_CmpUnspecifiedParam, partial_ordering __v) noexcept { return __v < 0 ? partial_ordering::greater : (__v > 0 ? partial_ordering::less : __v); } -#endif // _LIBCPP_HAS_NO_SPACESHIP_OPERATOR class weak_ordering { using _ValueT = signed char; @@ -295,24 +274,19 @@ // comparisons _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator==(weak_ordering __v, _CmpUnspecifiedParam) noexcept; - _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator!=(weak_ordering __v, _CmpUnspecifiedParam) noexcept; _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator< (weak_ordering __v, _CmpUnspecifiedParam) noexcept; _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator<=(weak_ordering __v, _CmpUnspecifiedParam) noexcept; _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator> (weak_ordering __v, _CmpUnspecifiedParam) noexcept; _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator>=(weak_ordering __v, _CmpUnspecifiedParam) noexcept; - _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator==(_CmpUnspecifiedParam, weak_ordering __v) noexcept; - _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator!=(_CmpUnspecifiedParam, weak_ordering __v) noexcept; _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator< (_CmpUnspecifiedParam, weak_ordering __v) noexcept; _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator<=(_CmpUnspecifiedParam, weak_ordering __v) noexcept; _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator> (_CmpUnspecifiedParam, weak_ordering __v) noexcept; _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator>=(_CmpUnspecifiedParam, weak_ordering __v) noexcept; -#ifndef _LIBCPP_HAS_NO_SPACESHIP_OPERATOR _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator==(weak_ordering, weak_ordering) noexcept = default; _LIBCPP_INLINE_VISIBILITY friend constexpr weak_ordering operator<=>(weak_ordering __v, _CmpUnspecifiedParam) noexcept; _LIBCPP_INLINE_VISIBILITY friend constexpr weak_ordering operator<=>(_CmpUnspecifiedParam, weak_ordering __v) noexcept; -#endif private: _ValueT __value_; @@ -327,10 +301,6 @@ return __v.__value_ == 0; } _LIBCPP_INLINE_VISIBILITY -constexpr bool operator!=(weak_ordering __v, _CmpUnspecifiedParam) noexcept { - return __v.__value_ != 0; -} -_LIBCPP_INLINE_VISIBILITY constexpr bool operator< (weak_ordering __v, _CmpUnspecifiedParam) noexcept { return __v.__value_ < 0; } @@ -347,14 +317,6 @@ return __v.__value_ >= 0; } _LIBCPP_INLINE_VISIBILITY -constexpr bool operator==(_CmpUnspecifiedParam, weak_ordering __v) noexcept { - return 0 == __v.__value_; -} -_LIBCPP_INLINE_VISIBILITY -constexpr bool operator!=(_CmpUnspecifiedParam, weak_ordering __v) noexcept { - return 0 != __v.__value_; -} -_LIBCPP_INLINE_VISIBILITY constexpr bool operator< (_CmpUnspecifiedParam, weak_ordering __v) noexcept { return 0 < __v.__value_; } @@ -371,7 +333,6 @@ return 0 >= __v.__value_; } -#ifndef _LIBCPP_HAS_NO_SPACESHIP_OPERATOR _LIBCPP_INLINE_VISIBILITY constexpr weak_ordering operator<=>(weak_ordering __v, _CmpUnspecifiedParam) noexcept { return __v; @@ -380,8 +341,6 @@ constexpr weak_ordering operator<=>(_CmpUnspecifiedParam, weak_ordering __v) noexcept { return __v < 0 ? weak_ordering::greater : (__v > 0 ? weak_ordering::less : __v); } -#endif // _LIBCPP_HAS_NO_SPACESHIP_OPERATOR - class strong_ordering { using _ValueT = signed char; @@ -411,24 +370,19 @@ // comparisons _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator==(strong_ordering __v, _CmpUnspecifiedParam) noexcept; - _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator!=(strong_ordering __v, _CmpUnspecifiedParam) noexcept; _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator< (strong_ordering __v, _CmpUnspecifiedParam) noexcept; _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator<=(strong_ordering __v, _CmpUnspecifiedParam) noexcept; _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator> (strong_ordering __v, _CmpUnspecifiedParam) noexcept; _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator>=(strong_ordering __v, _CmpUnspecifiedParam) noexcept; - _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator==(_CmpUnspecifiedParam, strong_ordering __v) noexcept; - _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator!=(_CmpUnspecifiedParam, strong_ordering __v) noexcept; _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator< (_CmpUnspecifiedParam, strong_ordering __v) noexcept; _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator<=(_CmpUnspecifiedParam, strong_ordering __v) noexcept; _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator> (_CmpUnspecifiedParam, strong_ordering __v) noexcept; _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator>=(_CmpUnspecifiedParam, strong_ordering __v) noexcept; -#ifndef _LIBCPP_HAS_NO_SPACESHIP_OPERATOR _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator==(strong_ordering, strong_ordering) noexcept = default; _LIBCPP_INLINE_VISIBILITY friend constexpr strong_ordering operator<=>(strong_ordering __v, _CmpUnspecifiedParam) noexcept; _LIBCPP_INLINE_VISIBILITY friend constexpr strong_ordering operator<=>(_CmpUnspecifiedParam, strong_ordering __v) noexcept; -#endif private: _ValueT __value_; @@ -444,10 +398,6 @@ return __v.__value_ == 0; } _LIBCPP_INLINE_VISIBILITY -constexpr bool operator!=(strong_ordering __v, _CmpUnspecifiedParam) noexcept { - return __v.__value_ != 0; -} -_LIBCPP_INLINE_VISIBILITY constexpr bool operator< (strong_ordering __v, _CmpUnspecifiedParam) noexcept { return __v.__value_ < 0; } @@ -464,14 +414,6 @@ return __v.__value_ >= 0; } _LIBCPP_INLINE_VISIBILITY -constexpr bool operator==(_CmpUnspecifiedParam, strong_ordering __v) noexcept { - return 0 == __v.__value_; -} -_LIBCPP_INLINE_VISIBILITY -constexpr bool operator!=(_CmpUnspecifiedParam, strong_ordering __v) noexcept { - return 0 != __v.__value_; -} -_LIBCPP_INLINE_VISIBILITY constexpr bool operator< (_CmpUnspecifiedParam, strong_ordering __v) noexcept { return 0 < __v.__value_; } @@ -488,7 +430,6 @@ return 0 >= __v.__value_; } -#ifndef _LIBCPP_HAS_NO_SPACESHIP_OPERATOR _LIBCPP_INLINE_VISIBILITY constexpr strong_ordering operator<=>(strong_ordering __v, _CmpUnspecifiedParam) noexcept { return __v; @@ -497,7 +438,6 @@ constexpr strong_ordering operator<=>(_CmpUnspecifiedParam, strong_ordering __v) noexcept { return __v < 0 ? strong_ordering::greater : (__v > 0 ? strong_ordering::less : __v); } -#endif // _LIBCPP_HAS_NO_SPACESHIP_OPERATOR // named comparison functions _LIBCPP_INLINE_VISIBILITY @@ -582,7 +522,7 @@ template constexpr weak_ordering weak_order(const _Tp& __lhs, const _Tp& __rhs); template constexpr partial_ordering partial_order(const _Tp& __lhs, const _Tp& __rhs); -#endif // _LIBCPP_STD_VER > 17 +#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_SPACESHIP_OPERATOR) _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/test/std/language.support/cmp/cmp.categories.pre/zero_type.verify.cpp b/libcxx/test/std/language.support/cmp/cmp.categories.pre/zero_type.verify.cpp --- a/libcxx/test/std/language.support/cmp/cmp.categories.pre/zero_type.verify.cpp +++ b/libcxx/test/std/language.support/cmp/cmp.categories.pre/zero_type.verify.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// // UNSUPPORTED: c++03, c++11, c++14, c++17 +// UNSUPPORTED: apple-clang-9, apple-clang-10, apple-clang-11, apple-clang-12.0.0 // diff --git a/libcxx/test/std/language.support/cmp/cmp.partialord/partialord.pass.cpp b/libcxx/test/std/language.support/cmp/cmp.partialord/partialord.pass.cpp --- a/libcxx/test/std/language.support/cmp/cmp.partialord/partialord.pass.cpp +++ b/libcxx/test/std/language.support/cmp/cmp.partialord/partialord.pass.cpp @@ -7,6 +7,7 @@ //===----------------------------------------------------------------------===// // UNSUPPORTED: c++03, c++11, c++14, c++17 +// UNSUPPORTED: apple-clang-9, apple-clang-10, apple-clang-11, apple-clang-12.0.0 // diff --git a/libcxx/test/std/language.support/cmp/cmp.strongord/strongord.pass.cpp b/libcxx/test/std/language.support/cmp/cmp.strongord/strongord.pass.cpp --- a/libcxx/test/std/language.support/cmp/cmp.strongord/strongord.pass.cpp +++ b/libcxx/test/std/language.support/cmp/cmp.strongord/strongord.pass.cpp @@ -7,6 +7,7 @@ //===----------------------------------------------------------------------===// // UNSUPPORTED: c++03, c++11, c++14, c++17 +// UNSUPPORTED: apple-clang-9, apple-clang-10, apple-clang-11, apple-clang-12.0.0 // diff --git a/libcxx/test/std/language.support/cmp/cmp.weakord/weakord.pass.cpp b/libcxx/test/std/language.support/cmp/cmp.weakord/weakord.pass.cpp --- a/libcxx/test/std/language.support/cmp/cmp.weakord/weakord.pass.cpp +++ b/libcxx/test/std/language.support/cmp/cmp.weakord/weakord.pass.cpp @@ -7,6 +7,7 @@ //===----------------------------------------------------------------------===// // UNSUPPORTED: c++03, c++11, c++14, c++17 +// UNSUPPORTED: apple-clang-9, apple-clang-10, apple-clang-11, apple-clang-12.0.0 //