<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/55823>55823</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            libc++: `hash` for `basic_string(_view)` is enabled for all possible element types
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          frederick-vs-ja
      </td>
    </tr>
</table>

<pre>
    E.g. this program compiles ([godbolt link](https://godbolt.org/z/8EMrcMoGe)):
```C++
#include <string>
#include <string_view>

int main()
{
    using intstring = std::basic_string<int>;
    using intstring_view = std::basic_string_view<int>;
    (void)std::hash<intstring>{}(intstring{});
    (void)std::hash<intstring_view>{}(intstring_view{});
}
```

It seems intended to restrict the enabled specializations for `basic_string(_view)` of encoded character types (`char`, `char8_t`, `char16_t`, `char32_t`, and `wchar_t`) only:
- The C++11~17 standard originally only enabled full specializations for `std::string` etc.
- [LWG2978](https://cplusplus.github.io/LWG/issue2978) (DR against C++17) enabled specializations for `pmr` types.
- And then [P0482R6](https://wg21.link/p0482r6) provided enabled specializations for `std::u8string` and `std::pmr::u8string`.
- There is now an open issue [LWG3705](https://cplusplus.github.io/LWG/issue3705) (possibly intended to be DR against C++11) that wants to enable specializations for `basic_string` with all allocators, but **not all element types**.

I suppose that libc++ should restrict enabled specializations to `basic_string(_view)` of encoded character types only.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJydVdtuozAQ_Rp4sYLANFweeEiTtFppK62qlfaxMrYBtw5GtkmUfv2OgZKmTdTdRiYJc_OZMzN2qdix2AZ1gGwjDOq0qjXZIap2nZDcIA9n3vK2VqxU0iIp2hdvuQFhY21nvHjl4TtYkz5Quoa3V3iy7YOmD-qeezh3CyzDjReuvCQc19rDt26NUhyLlsqeceTFa2O1aGsv3l5XPu0FP5wshm_RWrQjonWQYcdRk047IPj0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