<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/64711>64711</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Clang-17: [Regression] Static assert no longer allows wide literals
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
JVApen
</td>
</tr>
</table>
<pre>
I found this issue on our code base with LLVM17-RC2 compiled with clang-cl and C++17. Someone managed to write: `static_assert(true, _T("SomeString"));` equivalent to ` static_assert(true, L"SomeString");`
This was accepted in LLVM16, though fails on LLVM17.
The message that is given: `an unevaluated string literal cannot have an encoding prefix`.
Reading through the release notes (https://github.com/llvm/llvm-project/blob/release/17.x/clang/docs/ReleaseNotes.rst), I found:
- > artially implemented [P2361R6: Unevaluated strings](https://wg21.link/P2361R6). The changes to attributes declarations are not part of this release.
- I don't expect this to influence C++17 compilation
- > Reject increment of bool value in unevaluated contexts after C++17. (https://github.com/llvm/llvm-project/issues/47517).
- Ain't linked to the message given
- > Clang now implements [temp.deduct]p9. Substitution failures inside lambdas from unevaluated contexts will be surfaced as errors. They were previously handled as SFINAE.
- Not linked to static_assert
Although this is easy to fix (which I will do in our code), this is an unexpected change in the upgrade. Either this should be accepted again, or it should have been mentioned as a breaking change in the release notes. (I'm in favor of the second)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycVc1u2zgQfhr6MrAgUZJlH3xw4hrIolssnG6vxYgcSdxSpJak7OTtF6Sc1kG7lwIBApicGX5_I_Re9YZoz-oHVh9XOIfBuv0fXw4TmVVr5ev-CTo7GwlhUB6U9zOBNWBnB8JKghY9wVWFAT5-_PJn0azPjxyEHSelSS4HQqPp10IDGgmPjD8w_lA0GTzbkawhGNFgTxKChatTgVh5ALbJfcCgxFf0nlxgfBvcTIw_wtfPjG8Z57H8OThlesY547v4Vz6wTQ7076wuqMmE2DP-8n-9P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