[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / Lexer / cxx2c-raw-strings.cpp
blobcf114e57d8bb11e42364b70fba097abc15e09b31
1 // RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify=precxx26,expected -Wc++26-extensions %s
2 // RUN: %clang_cc1 -std=c++2c -fsyntax-only -verify=cxx26,expected -Wpre-c++26-compat %s
4 int main() {
5 (void) R"abc`@$(foobar)abc`@$";
6 //precxx26-warning@-1 {{'`' in a raw string literal delimiter is a C++2c extension}}
7 //precxx26-warning@-2 {{'@' in a raw string literal delimiter is a C++2c extension}}
8 //precxx26-warning@-3 {{'$' in a raw string literal delimiter is a C++2c extension}}
9 //cxx26-warning@-4 {{'`' in a raw string literal delimiter is incompatible with standards before C++2c}}
10 //cxx26-warning@-5 {{'@' in a raw string literal delimiter is incompatible with standards before C++2c}}
11 //cxx26-warning@-6 {{'$' in a raw string literal delimiter is incompatible with standards before C++2c}}
13 (void) R"\t()\t";
14 // expected-error@-1 {{invalid character '\' in raw string delimiter}}
15 // expected-error@-2 {{expected expression}}
17 (void) R" () ";
18 // expected-error@-1 {{invalid character ' ' in raw string delimiter}}
19 // expected-error@-2 {{expected expression}}
21 (void) R"\()\";
22 // expected-error@-1 {{invalid character '\' in raw string delimiter}}
23 // expected-error@-2 {{expected expression}}
25 (void) R"@(foo)@";
26 // cxx26-warning@-1 {{'@' in a raw string literal delimiter is incompatible with standards before C++2c}}
27 // precxx26-warning@-2 {{'@' in a raw string literal delimiter is a C++2c extension}}