OSDN Git Service

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