<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Wed, May 13, 2026 at 2:32 PM Jonathan Wakely <<a href="mailto:jwakely@redhat.com">jwakely@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Wed, 13 May 2026 at 12:57, Tomasz Kamiński <<a href="mailto:tkaminsk@redhat.com" target="_blank">tkaminsk@redhat.com</a>> wrote:<br>
><br>
> Als uses type_identity_t in operator<=> signature to make it consistient<br>
> with operator==.<br>
><br>
> libstdc++-v3/ChangeLog:<br>
><br>
>         * include/std/string_view: Add _GLIBCXX_RESOLVE_LIB_DEFECTS<br>
>         comment for LWG3950.<br>
>         (operator<=>): Use type_identity_t instead of __type_identity_t.<br>
> ---<br>
> The consistency change technically changes signature, but that is fine,<br>
<br>
See <a href="https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114400" rel="noreferrer" target="_blank">https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114400</a></blockquote><div>I think we should still define __type_identity as alias to type_identity when</div><div>the later is available, so we will not have two instantiations for each type</div><div>(one for code that is C++17 compatible and use __type_identity, and </div><div>other commint from user programs).</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
<br>
> not sure if it is worth it. Should we make __type_identity an alias to<br>
> type_identity for modes when later is defined.<br>
><br>
> Tested on x86_64-linux. OK for trunk?<br>
><br>
>  libstdc++-v3/include/std/string_view | 5 ++++-<br>
>  1 file changed, 4 insertions(+), 1 deletion(-)<br>
><br>
> diff --git a/libstdc++-v3/include/std/string_view b/libstdc++-v3/include/std/string_view<br>
> index 735d46f2de7..efbf432f112 100644<br>
> --- a/libstdc++-v3/include/std/string_view<br>
> +++ b/libstdc++-v3/include/std/string_view<br>
> @@ -621,6 +621,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION<br>
>    // type (see N3766).<br>
><br>
>  #if __cpp_lib_three_way_comparison<br>
> +  // _GLIBCXX_RESOLVE_LIB_DEFECTS<br>
> +  // 3950. std::basic_string_view comparison operators are overspecified<br>
> +<br>
>    template<typename _CharT, typename _Traits><br>
>      [[nodiscard]]<br>
>      constexpr bool<br>
> @@ -633,7 +636,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION<br>
>      [[nodiscard]]<br>
>      constexpr auto<br>
>      operator<=>(basic_string_view<_CharT, _Traits> __x,<br>
> -               __type_identity_t<basic_string_view<_CharT, _Traits>> __y)<br>
> +               type_identity_t<basic_string_view<_CharT, _Traits>> __y)<br>
>      noexcept<br>
>      -> decltype(__detail::__char_traits_cmp_cat<_Traits>(0))<br>
>      { return __detail::__char_traits_cmp_cat<_Traits>(__x.compare(__y)); }<br>
> --<br>
> 2.54.0<br>
><br>
<br>
</blockquote></div></div>