From: Jonathan Wakely Date: Wed, 18 Sep 2024 15:17:28 +0000 (+0100) Subject: libstdc++: Use constexpr instead of _GLIBCXX20_CONSTEXPR in X-Git-Tag: releases/gcc-14.3.0~751 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=986c71c169378c0bdce41f02377699f29e4a3203;p=thirdparty%2Fgcc.git libstdc++: Use constexpr instead of _GLIBCXX20_CONSTEXPR in 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. (cherry picked from commit b6463161c3cd0b1f764697290d9569c7153b8a5b) --- diff --git a/libstdc++-v3/include/bits/stl_vector.h b/libstdc++-v3/include/bits/stl_vector.h index 31169711a489..b7ee62025251 100644 --- a/libstdc++-v3/include/bits/stl_vector.h +++ b/libstdc++-v3/include/bits/stl_vector.h @@ -2051,7 +2051,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`. @@ -2064,8 +2064,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER * `<` and `>=` etc. */ template - [[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(),