[PATCH] D156596: [Clang] Produce a warning instead of an error in unevaluated strings before C++26

Hubert Tong via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 31 16:14:16 PDT 2023


hubert.reinterpretcast added inline comments.


================
Comment at: clang/test/SemaCXX/static-assert.cpp:44-45
+static_assert(false, L"\x1ff"    // expected-warning {{encoding prefix 'L' on an unevaluated string literal has no effect and is incompatible with c++2c}} \
+                                 // expected-error {{hex escape sequence out of range}} \
                                  // expected-error {{invalid escape sequence '\x1ff' in an unevaluated string literal}}
                      "0\x123"    // expected-error {{invalid escape sequence '\x123' in an unevaluated string literal}}
----------------
I doubt that it is a problem, but Clang 16 accepted such hex escapes.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D156596/new/

https://reviews.llvm.org/D156596



More information about the cfe-commits mailing list