diff options
author | cor3ntin <corentinjabot@gmail.com> | 2024-05-28 15:38:02 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-28 15:38:02 +0200 |
commit | 2ace7bdcfe640c69bd4dcf508d39485e0ef7ea06 (patch) | |
tree | 7f34f35f4a96147e4f071b931a6db45778c20235 /clang/test/Lexer | |
parent | 8995ccc4460ed8a90dcc9bd023743a8f59458f50 (diff) | |
download | llvm-2ace7bdcfe640c69bd4dcf508d39485e0ef7ea06.zip llvm-2ace7bdcfe640c69bd4dcf508d39485e0ef7ea06.tar.gz llvm-2ace7bdcfe640c69bd4dcf508d39485e0ef7ea06.tar.bz2 |
[Clang] allow `` `@$ `` in raw string delimiters in C++26 (#93216)
And as an extension in older language modes.
Per https://eel.is/c++draft/lex.string#nt:d-char
Fixes #93130
Diffstat (limited to 'clang/test/Lexer')
-rw-r--r-- | clang/test/Lexer/cxx2c-raw-strings.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/test/Lexer/cxx2c-raw-strings.cpp b/clang/test/Lexer/cxx2c-raw-strings.cpp new file mode 100644 index 0000000..569a4b8 --- /dev/null +++ b/clang/test/Lexer/cxx2c-raw-strings.cpp @@ -0,0 +1,12 @@ +// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify -Wc++26-extensions %s +// RUN: %clang_cc1 -std=c++2c -fsyntax-only -verify=cxx26 -Wpre-c++26-compat %s + +int main() { + (void) R"abc`@$(foobar)abc`@$"; + //expected-warning@-1 {{'`' in a raw string literal delimiter is a C++2c extension}} + //expected-warning@-2 {{'@' in a raw string literal delimiter is a C++2c extension}} + //expected-warning@-3 {{'$' in a raw string literal delimiter is a C++2c extension}} + //cxx26-warning@-4 {{'`' in a raw string literal delimiter is incompatible with standards before C++2c}} + //cxx26-warning@-5 {{'@' in a raw string literal delimiter is incompatible with standards before C++2c}} + //cxx26-warning@-6 {{'$' in a raw string literal delimiter is incompatible with standards before C++2c}} +} |