Index: libcxx/include/compare =================================================================== --- libcxx/include/compare +++ libcxx/include/compare @@ -248,6 +248,8 @@ _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 @@ -364,6 +366,8 @@ _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 @@ -490,6 +494,8 @@ _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 Index: libcxx/test/std/language.support/cmp/cmp.partialord/partialord.pass.cpp =================================================================== --- libcxx/test/std/language.support/cmp/cmp.partialord/partialord.pass.cpp +++ libcxx/test/std/language.support/cmp/cmp.partialord/partialord.pass.cpp @@ -150,6 +150,42 @@ break; } } + { + static_assert(std::partial_ordering::less == std::partial_ordering::less); + static_assert(std::partial_ordering::less != + std::partial_ordering::equivalent); + static_assert(std::partial_ordering::less != + std::partial_ordering::greater); + static_assert(std::partial_ordering::less != + std::partial_ordering::unordered); + + static_assert(std::partial_ordering::equivalent != + std::partial_ordering::less); + static_assert(std::partial_ordering::equivalent == + std::partial_ordering::equivalent); + static_assert(std::partial_ordering::equivalent != + std::partial_ordering::greater); + static_assert(std::partial_ordering::equivalent != + std::partial_ordering::unordered); + + static_assert(std::partial_ordering::greater != + std::partial_ordering::less); + static_assert(std::partial_ordering::greater != + std::partial_ordering::equivalent); + static_assert(std::partial_ordering::greater == + std::partial_ordering::greater); + static_assert(std::partial_ordering::greater != + std::partial_ordering::unordered); + + static_assert(std::partial_ordering::unordered != + std::partial_ordering::less); + static_assert(std::partial_ordering::unordered != + std::partial_ordering::equivalent); + static_assert(std::partial_ordering::unordered != + std::partial_ordering::greater); + static_assert(std::partial_ordering::unordered == + std::partial_ordering::unordered); + } #endif return true; Index: libcxx/test/std/language.support/cmp/cmp.strongord/strongord.pass.cpp =================================================================== --- libcxx/test/std/language.support/cmp/cmp.strongord/strongord.pass.cpp +++ libcxx/test/std/language.support/cmp/cmp.strongord/strongord.pass.cpp @@ -198,6 +198,20 @@ break; } } + { + static_assert(std::strong_ordering::less == std::strong_ordering::less); + static_assert(std::strong_ordering::less != std::strong_ordering::equal); + static_assert(std::strong_ordering::less != std::strong_ordering::greater); + + static_assert(std::strong_ordering::equal != std::strong_ordering::less); + static_assert(std::strong_ordering::equal == std::strong_ordering::equal); + static_assert(std::strong_ordering::equal != std::strong_ordering::greater); + + static_assert(std::strong_ordering::greater != std::strong_ordering::less); + static_assert(std::strong_ordering::greater != std::strong_ordering::equal); + static_assert(std::strong_ordering::greater == + std::strong_ordering::greater); + } #endif return true; Index: libcxx/test/std/language.support/cmp/cmp.weakord/weakord.pass.cpp =================================================================== --- libcxx/test/std/language.support/cmp/cmp.weakord/weakord.pass.cpp +++ libcxx/test/std/language.support/cmp/cmp.weakord/weakord.pass.cpp @@ -155,6 +155,23 @@ break; } } + + { + static_assert(std::weak_ordering::less == std::weak_ordering::less); + static_assert(std::weak_ordering::less != std::weak_ordering::equivalent); + static_assert(std::weak_ordering::less != std::weak_ordering::greater); + + static_assert(std::weak_ordering::equivalent != std::weak_ordering::less); + static_assert(std::weak_ordering::equivalent == + std::weak_ordering::equivalent); + static_assert(std::weak_ordering::equivalent != + std::weak_ordering::greater); + + static_assert(std::weak_ordering::greater != std::weak_ordering::less); + static_assert(std::weak_ordering::greater != + std::weak_ordering::equivalent); + static_assert(std::weak_ordering::greater == std::weak_ordering::greater); + } #endif return true;