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

    <tr>
        <th>Summary</th>
        <td>
            [clang] [c++20] build failure with libstdc++'s ranges code
        </td>
    </tr>

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

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

    <tr>
      <th>Reporter</th>
      <td>
          h-2
      </td>
    </tr>
</table>

<pre>
    ```cpp
#include <ranges>
#include <string_view>
#include <string>
#include <vector>

int main()
{
    auto s = std::vector<std::string>{};
    auto v = s | std::views::transform([] (std::string & s2) { return std::string_view{s2}; })
               | std::views::join;
    auto b = std::ranges::begin(v); 
}
```
[godbolt](https://godbolt.org/z/Yx3aG75zM)


This builds with llvm-trunk&libc++, and it builds with gcc12&libstdc++, but it fails to build with llvm-trunk&libstdc++.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx8U02TmzwM_jXiotkMiPDhA4cleXlPvfXSU8dgB7x1TMY2Sbu_vmMgzUd3y3hsGcmP9DyyuXOqN1JWkNWQ7SM--WG01fBCUTuKXxXk8TK60wniPcSvQKkynZ6EREh3lpteOkj_-8jpvFWm_35W8vLPiE-cZ9n50d6c86yMxyNXBqgEYqunqBcDEZFPfkSHkO7ReQHpK6SvV6Tdnz-3xEUNxR7SZ4TzgoBQ7O5wlLy4xfSWG3cY7TEUMmuHQOUTPgLl6AiIIRQ1Wukna_ApaNGnqB0thWBYrtTw8fusmrdRmb85tI8qXHsV7Fb2s4bnkCnkXIXcr8a17es2q_tRtKP2kO2BysH70wxEDVCzujaj7YGad6Dm28-U_19k719uLbqbvw7KYTspLRxelB9Q6_PxxdvJ_ADKtWo7oHoeO-RGoPIP0X3XJbQEOi_uYtvJh9gDV9phoB8OfZzhdnATiSoVLGU8klWSFzHbsrwoo6HKs7hMecdISlawJGsPbSYPlBMTImcpj1RFMVFCSZrk2yQpNyLhvGCHsmXswOIig20sj1zpTUgf5ImUc5OsMpbFSaR5K7WbHx6RkRecnUAU3qGt5pLbqXewjbVy3t1QvPJ6frGd5qafr15Wr3woDvuFelBisnKV4FGuwuFyH7AbhYwmq6unrio_TO2mG49ATUi9Li8nO77JzgM1c8EOqJkJ_Q4AAP__SHZA1Q">