<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/77170>77170</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
`std::filesystem::canonical("")` should throw
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Pesa
</td>
</tr>
</table>
<pre>
Per [fs.op.canonical](https://eel.is/c++draft/fs.op.canonical), `!exists(p) is an error`. However, calling `canonical("")` returns the current path instead of raising an exception.
Tested with Apple clang version 15.0.0 (clang-1500.1.0.2.5) and `-std=c++17`.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx0UsuOozAQ_JrmYsUyDcbhwCHZKNrjHPYHjGnAK8dGtklm_n5lZqR9SCshLD-ququrdEp28UQDyCvIW6X3vIY4vFHS1Rimj-GNIgN5nRMPGzfaB2-NdiBvgOc15y1BcwG8A96JHLcJ8G4Ar4DXKeo5A97_hWIP-I1BJwBrercpJ8DzBtgzm5j2jGIMETrB2ffwoifF8txo56xfCuwPpjMgHl8PnWCR8h59YnklZvYYyWe26bwy61MmPbEws6htKjylzruhLdvgOYgbiMvn_welTBN72byyy7Y5YsZpv7AnxWSDZ7XkggsGeD7OT7UUgtdccOSyaNB-Kk2eUp6guX2NolZFTzUNzdQ3va5oqJVopejVuavW4Tx302h0S83YG9G1jWqplWpUaBDrVlV2QIGtqEUnUHbYcRKzko2ZZIsd9VJBK-ihrePOPR88xKWyKe00KFUrUTk9kkuHxYieXuy4LIOTtyoOBXMa9yVBK1zx4zdLttnRAJ045FyguczWUfpImR6f-_-6kdawu4nlNYZXtUc3_J2WxeZ1H7kJD8B7qfe1nLYYfpIpwTm6LIE6VPwKAAD__1Tj0Mc">