https://gcc.gnu.org/g:794d05a7f3c1cf07058467044938a7105401a649
commit r14-12904-g794d05a7f3c1cf07058467044938a7105401a649 Author: Tomasz Kamiński <[email protected]> Date: Wed May 13 11:51:25 2026 +0200 libstdc++: Use type_identity_t for operator<=> parameter [PR114400] This matches change to operator== from r14-9642-gf4605c53ea2eeaf, and implements exact resolution of LWG3950, "std::basic_string_view comparison operators are overspecified". The difference between __type_identity and type_identity is observable as illustrated by PR. libstdc++-v3/ChangeLog: PR libstdc++/114400 * include/std/string_view (operator<=>): Use type_identity_t instead of __type_identity_t. Reviewed-by: Jonathan Wakely <[email protected]> Signed-off-by: Tomasz Kamiński <[email protected]> (cherry picked from commit bbcc9da1f026b202c692e0b47eeacd28e0c69c0d) Diff: --- libstdc++-v3/include/std/string_view | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libstdc++-v3/include/std/string_view b/libstdc++-v3/include/std/string_view index 4bce4ba21b4d..2dd6b24e92d3 100644 --- a/libstdc++-v3/include/std/string_view +++ b/libstdc++-v3/include/std/string_view @@ -606,6 +606,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // type (see N3766). #if __cpp_lib_three_way_comparison + // _GLIBCXX_RESOLVE_LIB_DEFECTS + // 3950. std::basic_string_view comparison operators are overspecified + template<typename _CharT, typename _Traits> [[nodiscard]] constexpr bool @@ -618,7 +621,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION [[nodiscard]] constexpr auto operator<=>(basic_string_view<_CharT, _Traits> __x, - __type_identity_t<basic_string_view<_CharT, _Traits>> __y) + type_identity_t<basic_string_view<_CharT, _Traits>> __y) noexcept -> decltype(__detail::__char_traits_cmp_cat<_Traits>(0)) { return __detail::__char_traits_cmp_cat<_Traits>(__x.compare(__y)); }
