1 // If not c++0x/gnu99, the {,u,u8,U,L}R prefix should be parsed as separate
2 // token.
3 // { dg-do compile }
4 // { dg-options "-std=gnu89" { target c } }
5 // { dg-options "-std=c++98" { target c++ } }
6
7 const void *s0 = R"(a)"; // { dg-error "was not declared|undeclared" "undeclared" }
8 // { dg-error "expected ',' or ';'" "expected" { target c } .-1 }
9 const void *s1 = uR"(a)"; // { dg-error "was not declared|undeclared" "undeclared" }
10 // { dg-error "expected ',' or ';'" "expected" { target c } .-1 }
11 const void *s2 = UR"(a)"; // { dg-error "was not declared|undeclared" "undeclared" }
12 // { dg-error "expected ',' or ';'" "expected" { target c } .-1 }
13 const void *s3 = u8R"(a)"; // { dg-error "was not declared|undeclared" "undeclared" }
14 // { dg-error "expected ',' or ';'" "expected" { target c } .-1 }
15 const void *s4 = LR"(a)"; // { dg-error "was not declared|undeclared" "undeclared" }
16 // { dg-error "expected ',' or ';'" "expected" { target c } .-1 }
17
18 const int i0 = R'a'; // { dg-error "was not declared" "undeclared" { target c++ } }
19 // { dg-error "expected ',' or ';'" "expected" { target c } .-1 }
20 const int i1 = uR'a'; // { dg-error "was not declared" "undeclared" { target c++ } }
21 // { dg-error "expected ',' or ';'" "expected" { target c } .-1 }
22 const int i2 = UR'a'; // { dg-error "was not declared" "undeclared" { target c++ } }
23 // { dg-error "expected ',' or ';'" "expected" { target c } .-1 }
24 const int i3 = u8R'a'; // { dg-error "was not declared" "undeclared" { target c++ } }
25 // { dg-error "expected ',' or ';'" "expected" { target c } .-1 }
26 const int i4 = LR'a'; // { dg-error "was not declared" "undeclared" { target c++ } }
27 // { dg-error "expected ',' or ';'" "expected" { target c } .-1 }
28
29 #define R "a"
30 #define uR "b"
31 #define UR "c"
32 #define u8R "d"
33 #define LR "e"
34
35 const void *s5 = R"(a)";
36 const void *s6 = uR"(a)";
37 const void *s7 = UR"(a)";
38 const void *s8 = u8R"(a)";
39 const void *s9 = LR"(a)";
40
41 #undef R
42 #undef uR
43 #undef UR
44 #undef u8R
45 #undef LR
46
47 #define R 1 +
48 #define uR 2 +
49 #define UR 3 +
50 #define u8R 4 +
51 #define LR 5 +
52
53 const int i5 = R'a';
54 const int i6 = uR'a';
55 const int i7 = UR'a';
56 const int i8 = u8R'a';
57 const int i9 = LR'a';
58
main()59 int main () {}
60