Debian Codegraph @

gcc/testsuite/g++.dg/cpp23/named-universal-char-escape2.C

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