[libc++] Remove _LIBCPP_HAS_NO_SPACESHIP_OPERATOR

All supported compilers support spaceship in C++20 nowadays.

Differential Revision: https://reviews.llvm.org/D113938

GitOrigin-RevId: c0f87e83820b73610e9352a46f0c386d6aa91767
diff --git a/include/__compare/common_comparison_category.h b/include/__compare/common_comparison_category.h
index 09afb06..37a28db 100644
--- a/include/__compare/common_comparison_category.h
+++ b/include/__compare/common_comparison_category.h
@@ -19,7 +19,7 @@
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_SPACESHIP_OPERATOR)
+#if _LIBCPP_STD_VER > 17
 
 namespace __comp_detail {
 
@@ -87,7 +87,7 @@
 template<class... _Ts>
 using common_comparison_category_t = typename common_comparison_category<_Ts...>::type;
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_SPACESHIP_OPERATOR)
+#endif // _LIBCPP_STD_VER > 17
 
 _LIBCPP_END_NAMESPACE_STD
 
diff --git a/include/__compare/compare_three_way.h b/include/__compare/compare_three_way.h
index 492908a..3edddf1 100644
--- a/include/__compare/compare_three_way.h
+++ b/include/__compare/compare_three_way.h
@@ -20,7 +20,7 @@
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_SPACESHIP_OPERATOR) && !defined(_LIBCPP_HAS_NO_CONCEPTS)
+#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS)
 
 struct _LIBCPP_TEMPLATE_VIS compare_three_way
 {
@@ -34,7 +34,7 @@
     using is_transparent = void;
 };
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_SPACESHIP_OPERATOR) && !defined(_LIBCPP_HAS_NO_CONCEPTS)
+#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS)
 
 _LIBCPP_END_NAMESPACE_STD
 
diff --git a/include/__compare/ordering.h b/include/__compare/ordering.h
index b250c16..d4087bc 100644
--- a/include/__compare/ordering.h
+++ b/include/__compare/ordering.h
@@ -18,7 +18,7 @@
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_SPACESHIP_OPERATOR)
+#if _LIBCPP_STD_VER > 17
 
 // exposition only
 enum class _LIBCPP_ENUM_VIS _OrdResult : signed char {
@@ -312,7 +312,7 @@
 inline constexpr strong_ordering strong_ordering::equivalent(_OrdResult::__equiv);
 inline constexpr strong_ordering strong_ordering::greater(_OrdResult::__greater);
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_SPACESHIP_OPERATOR)
+#endif // _LIBCPP_STD_VER > 17
 
 _LIBCPP_END_NAMESPACE_STD
 
diff --git a/include/__compare/synth_three_way.h b/include/__compare/synth_three_way.h
index cc0b0f2..3d8e738 100644
--- a/include/__compare/synth_three_way.h
+++ b/include/__compare/synth_three_way.h
@@ -21,7 +21,7 @@
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_SPACESHIP_OPERATOR) && !defined(_LIBCPP_HAS_NO_CONCEPTS)
+#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS)
 
 // [expos.only.func]
 
@@ -44,7 +44,7 @@
 template <class _Tp, class _Up = _Tp>
 using __synth_three_way_result = decltype(__synth_three_way(declval<_Tp&>(), declval<_Up&>()));
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_SPACESHIP_OPERATOR) && !defined(_LIBCPP_HAS_NO_CONCEPTS)
+#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS)
 
 _LIBCPP_END_NAMESPACE_STD
 
diff --git a/include/__compare/three_way_comparable.h b/include/__compare/three_way_comparable.h
index 2560cf6..c479494 100644
--- a/include/__compare/three_way_comparable.h
+++ b/include/__compare/three_way_comparable.h
@@ -24,7 +24,7 @@
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_SPACESHIP_OPERATOR) && !defined(_LIBCPP_HAS_NO_CONCEPTS)
+#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS)
 
 template<class _Tp, class _Cat>
 concept __compares_as =
@@ -51,7 +51,7 @@
     { __u <=> __t } -> __compares_as<_Cat>;
   };
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_SPACESHIP_OPERATOR) && !defined(_LIBCPP_HAS_NO_CONCEPTS)
+#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS)
 
 _LIBCPP_END_NAMESPACE_STD
 
diff --git a/include/__config b/include/__config
index 90c0631..c09d5f3 100644
--- a/include/__config
+++ b/include/__config
@@ -1306,10 +1306,6 @@
 #define _LIBCPP_HAS_NO_CXX20_COROUTINES
 #endif
 
-#if !defined(__cpp_impl_three_way_comparison) || __cpp_impl_three_way_comparison < 201907L
-#define _LIBCPP_HAS_NO_SPACESHIP_OPERATOR
-#endif
-
 #if defined(_LIBCPP_COMPILER_IBM)
 #define _LIBCPP_HAS_NO_PRAGMA_PUSH_POP_MACRO
 #endif
diff --git a/include/__coroutine/coroutine_handle.h b/include/__coroutine/coroutine_handle.h
index bddd45e..64657c0 100644
--- a/include/__coroutine/coroutine_handle.h
+++ b/include/__coroutine/coroutine_handle.h
@@ -94,31 +94,6 @@
 };
 
 // [coroutine.handle.compare]
-#if defined(_LIBCPP_HAS_NO_SPACESHIP_OPERATOR)
-
-inline _LIBCPP_HIDE_FROM_ABI
-constexpr bool operator==(coroutine_handle<> __x, coroutine_handle<> __y) noexcept {
-    return __x.address() == __y.address();
-}
-inline _LIBCPP_HIDE_FROM_ABI
-constexpr bool operator<(coroutine_handle<> __x, coroutine_handle<> __y) noexcept {
-    return less<void*>()(__x.address(), __y.address());
-}
-inline _LIBCPP_HIDE_FROM_ABI
-constexpr bool operator>(coroutine_handle<> __x, coroutine_handle<> __y) noexcept {
-    return __y < __x;
-}
-inline _LIBCPP_HIDE_FROM_ABI
-constexpr bool operator<=(coroutine_handle<> __x, coroutine_handle<> __y) noexcept {
-    return !(__x > __y);
-}
-inline _LIBCPP_HIDE_FROM_ABI
-constexpr bool operator>=(coroutine_handle<> __x, coroutine_handle<> __y) noexcept {
-    return !(__x < __y);
-}
-
-#else
-
 inline _LIBCPP_HIDE_FROM_ABI
 constexpr bool operator==(coroutine_handle<> __x, coroutine_handle<> __y) noexcept {
     return __x.address() == __y.address();
@@ -128,8 +103,6 @@
     return compare_three_way()(__x.address(), __y.address());
 }
 
-#endif // defined(_LIBCPP_HAS_NO_SPACESHIP_OPERATOR)
-
 template <class _Promise>
 struct _LIBCPP_TEMPLATE_VIS coroutine_handle {
 public:
diff --git a/include/__ranges/transform_view.h b/include/__ranges/transform_view.h
index de1296c..208a9a2 100644
--- a/include/__ranges/transform_view.h
+++ b/include/__ranges/transform_view.h
@@ -303,14 +303,12 @@
     return __x.__current_ >= __y.__current_;
   }
 
-#if !defined(_LIBCPP_HAS_NO_SPACESHIP_OPERATOR)
   _LIBCPP_HIDE_FROM_ABI
   friend constexpr auto operator<=>(const __iterator& __x, const __iterator& __y)
     requires random_access_range<_Base> && three_way_comparable<iterator_t<_Base>>
   {
     return __x.__current_ <=> __y.__current_;
   }
-#endif // !defined(_LIBCPP_HAS_NO_SPACESHIP_OPERATOR)
 
   _LIBCPP_HIDE_FROM_ABI
   friend constexpr __iterator operator+(__iterator __i, difference_type __n)
diff --git a/include/__utility/pair.h b/include/__utility/pair.h
index 959a8db..f111469 100644
--- a/include/__utility/pair.h
+++ b/include/__utility/pair.h
@@ -330,7 +330,7 @@
     return __x.first == __y.first && __x.second == __y.second;
 }
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_SPACESHIP_OPERATOR) && !defined(_LIBCPP_HAS_NO_CONCEPTS)
+#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS)
 
 template <class _T1, class _T2>
 _LIBCPP_HIDE_FROM_ABI constexpr
@@ -345,7 +345,7 @@
     return _VSTD::__synth_three_way(__x.second, __y.second);
 }
 
-#else // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_SPACESHIP_OPERATOR) && !defined(_LIBCPP_HAS_NO_CONCEPTS)
+#else // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS)
 
 template <class _T1, class _T2>
 inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
@@ -387,7 +387,7 @@
     return !(__y < __x);
 }
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_SPACESHIP_OPERATOR) && !defined(_LIBCPP_HAS_NO_CONCEPTS)
+#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS)
 
 template <class _T1, class _T2>
 inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
diff --git a/include/compare b/include/compare
index ddb8313..ad658c9 100644
--- a/include/compare
+++ b/include/compare
@@ -149,7 +149,7 @@
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_SPACESHIP_OPERATOR)
+#if _LIBCPP_STD_VER > 17
 
 // [cmp.alg], comparison algorithms
 // TODO: unimplemented
@@ -157,7 +157,7 @@
 template<class _Tp> constexpr weak_ordering weak_order(const _Tp& __lhs, const _Tp& __rhs);
 template<class _Tp> constexpr partial_ordering partial_order(const _Tp& __lhs, const _Tp& __rhs);
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_SPACESHIP_OPERATOR)
+#endif // _LIBCPP_STD_VER > 17
 
 _LIBCPP_END_NAMESPACE_STD
 
diff --git a/include/tuple b/include/tuple
index 50d3114..1e671b9 100644
--- a/include/tuple
+++ b/include/tuple
@@ -1306,7 +1306,7 @@
     return __tuple_equal<sizeof...(_Tp)>()(__x, __y);
 }
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_SPACESHIP_OPERATOR) && !defined(_LIBCPP_HAS_NO_CONCEPTS)
+#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS)
 
 // operator<=>
 
@@ -1328,7 +1328,7 @@
     return _VSTD::__tuple_compare_three_way(__x, __y, index_sequence_for<_Tp...>{});
 }
 
-#else // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_SPACESHIP_OPERATOR) && !defined(_LIBCPP_HAS_NO_CONCEPTS)
+#else // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS)
 
 template <class ..._Tp, class ..._Up>
 inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
@@ -1398,7 +1398,7 @@
     return !(__y < __x);
 }
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_SPACESHIP_OPERATOR) && !defined(_LIBCPP_HAS_NO_CONCEPTS)
+#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS)
 
 // tuple_cat