Debian Codegraph @

gcc/testsuite/c-c++-common/cpp/named-universal-char-escape-7.c

raw
1 /* P2071R2 - Named universal character escapes */
2 /* { dg-do compile } */
3 /* { dg-require-effective-target wchar } */
4 /* { dg-options "-std=gnu99 -Wno-c++-compat -Wno-unicode" { target c } } */
5 /* { dg-options "-std=gnu++20 -Wno-unicode" { target c++ } } */
6
7 #define z(x) 0
8 #define a z(
9 int b = a\N{}); /* { dg-bogus "empty named universal character escape sequence; treating it as separate tokens" } */
10 int c = a\N{); /* { dg-bogus "'\\\\N\\\{' not terminated with '\\\}' after \\\\N\\\{; treating it as separate tokens" } */
11 int d = a\N);
12 int e = a\NARG);
13 int f = a\N{abc}); /* { dg-bogus "\\\\N\\\{abc\\\} is not a valid universal character; treating it as separate tokens" } */
14 int g = a\N{ABC.123}); /* { dg-bogus "'\\\\N\\\{' not terminated with '\\\}' after \\\\N\\\{ABC; treating it as separate tokens" } */
15 int h = a\N{NON-EXISTENT CHAR}); /* { dg-bogus "\\\\N\\\{NON-EXISTENT CHAR\\\} is not a valid universal character; treating it as separate tokens" } */
16 int i = a\N{Latin_Small_Letter_A_With_Acute}); /* { dg-bogus "\\\\N\\\{Latin_Small_Letter_A_With_Acute\\\} is not a valid universal character; treating it as separate tokens" } */
17 /* { dg-bogus "did you mean \\\\N\\\{LATIN SMALL LETTER A WITH ACUTE\\\}\\?" "" { target *-*-* } .-1 } */