diff mbox series

[committed] libstdc++: Use constexpr instead of _GLIBCXX20_CONSTEXPR in <vector>

Message ID 20240922164856.1435216-1-jwakely@redhat.com
State New
Headers show
Series [committed] libstdc++: Use constexpr instead of _GLIBCXX20_CONSTEXPR in <vector> | expand

Commit Message

Jonathan Wakely Sept. 22, 2024, 4:48 p.m. UTC
Tested x86_64-linux. Pushed to trunk.

-- >8 --

For the operator<=> overload we can use the 'constexpr' keyword
directly, because we know the language dialect is at least C++20.

libstdc++-v3/ChangeLog:

	* include/bits/stl_vector.h (operator<=>): Use constexpr
	instead of _GLIBCXX20_CONSTEXPR macro.
---
 libstdc++-v3/include/bits/stl_vector.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/libstdc++-v3/include/bits/stl_vector.h b/libstdc++-v3/include/bits/stl_vector.h
index 182ad41ed94..e284536ad31 100644
--- a/libstdc++-v3/include/bits/stl_vector.h
+++ b/libstdc++-v3/include/bits/stl_vector.h
@@ -2078,7 +2078,7 @@  _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
     { return (__x.size() == __y.size()
 	      && std::equal(__x.begin(), __x.end(), __y.begin())); }
 
-#if __cpp_lib_three_way_comparison
+#if __cpp_lib_three_way_comparison // >= C++20
   /**
    *  @brief  Vector ordering relation.
    *  @param  __x  A `vector`.
@@ -2091,8 +2091,8 @@  _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
    *  `<` and `>=` etc.
   */
   template<typename _Tp, typename _Alloc>
-    [[nodiscard]] _GLIBCXX20_CONSTEXPR
-    inline __detail::__synth3way_t<_Tp>
+    [[nodiscard]]
+    constexpr __detail::__synth3way_t<_Tp>
     operator<=>(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
     {
       return std::lexicographical_compare_three_way(__x.begin(), __x.end(),