Issue 64711
Summary Clang-17: [Regression] Static assert no longer allows wide literals
Labels new issue
Assignees
Reporter JVApen
    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)  
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to