Merge branches/gcc-4_8-branch rev 208968.
[official-gcc.git] / gcc-4_8-branch / gcc / testsuite / c-c++-common / raw-string-3.c
blobf20337fda49a1ad61854a59efc93e81da73405fe
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 "" { target c } }
5 // { dg-options "-std=c++98" { target c++ } }
7 const void *s0 = R"(a)"; // { dg-error "was not declared|undeclared" "undeclared" }
8 // { dg-error "expected ',' or ';'" "expected" { target c } 7 }
9 const void *s1 = uR"(a)"; // { dg-error "was not declared|undeclared" "undeclared" }
10 // { dg-error "expected ',' or ';'" expected" { target c } 9 }
11 const void *s2 = UR"(a)"; // { dg-error "was not declared|undeclared" "undeclared" }
12 // { dg-error "expected ',' or ';'" "expected" { target c } 11 }
13 const void *s3 = u8R"(a)"; // { dg-error "was not declared|undeclared" "undeclared" }
14 // { dg-error "expected ',' or ';'" "expected" { target c } 13 }
15 const void *s4 = LR"(a)"; // { dg-error "was not declared|undeclared" "undeclared" }
16 // { dg-error "expected ',' or ';'" "expected" { target c } 15 }
18 const int i0 = R'a'; // { dg-error "was not declared" "undeclared" { target c++ } }
19 // { dg-error "expected ',' or ';'" "expected" { target c } 18 }
20 const int i1 = uR'a'; // { dg-error "was not declared" "undeclared" { target c++ } }
21 // { dg-error "expected ',' or ';'" "expected" { target c } 20 }
22 const int i2 = UR'a'; // { dg-error "was not declared" "undeclared" { target c++ } }
23 // { dg-error "expected ',' or ';'" "expected" { target c } 22 }
24 const int i3 = u8R'a'; // { dg-error "was not declared" "undeclared" { target c++ } }
25 // { dg-error "expected ',' or ';'" "expected" { target c } 24 }
26 const int i4 = LR'a'; // { dg-error "was not declared" "undeclared" { target c++ } }
27 // { dg-error "expected ',' or ';'" "expected" { target c } 26 }
29 #define R "a"
30 #define uR "b"
31 #define UR "c"
32 #define u8R "d"
33 #define LR "e"
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)";
41 #undef R
42 #undef uR
43 #undef UR
44 #undef u8R
45 #undef LR
47 #define R 1 +
48 #define uR 2 +
49 #define UR 3 +
50 #define u8R 4 +
51 #define LR 5 +
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';
59 int main () {}