<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/64858>64858</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[libc++] `__assign_view` is declared noexcept but may throw on failing allocation
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
tobias-fire
</td>
</tr>
</table>
<pre>
The function `__assign_view` is declared `noexcept`:
https://github.com/llvm/llvm-project/blob/main/libcxx/include/__filesystem/path.h#L1072C1-L1076
However, it calls `std::basic_string<char>::basic_string<char>(std::string_view)` which is not declared `noexcept` and may throw when the allocation of memory for the new string fails. This results in a `std::terminate()` call.
The function should not be declared `noexcept`.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUUs1unDAQfprhYgXB8LNw4LBJinroMfeVbYa1K2OvbJPdffvK0DTJIa0qIXz4NDPfHw9Bny3RAM0jNM8ZX6NyfohOaB4eZu0pE266D1A8Q3F8UcTm1cqonWXQFqfTPn961XSFtmA6sImk4Z6mhFtHN0mXCG0B1ZHtS1SMlwDVEXAEHM86qlXk0i2AozGvb8_DxbufJCPgKIwTgOPCtU2gFvJ2Axy1lWadCHA8nWZtKNxDpDR-4VHlCrD6URYHfCof0tvux_f_d3elV_KAT0xHJrkxIdENcUq8qqPgQctTiF7bM1RPUnEP1be_Ytj9md6x3RPsky1XpaVK5lgXvzKIcTuxhd9ZVN5d2VWRZVER48Y4yTfH3cwWWpy_s9n5DbR0Zfs5NnNtQs5elA7MU1hNDExbxj8Ji-QXbXkkwO43t6Q-Zx_d-ZRyUG4100Zc0Ffc82waqqmvep7RULY9tuWhbQ6ZGmiiA-dVJ5oD1e3UikbyDtu5rg79JLsi0wMWWBUdlmVZ1SXmxEXbN72UopvqkhdQF7RwbfLUitz5c6ZDWGlo667pMsMFmbC1FzG5sYGAmMrsh61JYj0HqAujQwzvW6KOZqt9KhTgY_qa53-2-k01E2v8EJezWwApiPfAstWb4b_rvikIgOOm8FcAAAD__9AaLKo">