Debian Codegraph @

gcc/testsuite/c-c++-common/cpp/named-universal-char-escape-3.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" { target c } } */
5 /* { dg-options "-std=c++23" { target c++ } } */
6
7 #ifndef __cplusplus
8 typedef __CHAR32_TYPE__ char32_t;
9 #endif
10
11 const char32_t *a = U"\N{}"; /* { dg-error "empty named universal character escape sequence" } */
12 const char32_t *b = U"\N{NU" "LL}"; /* { dg-error "'\\\\N\\{' not terminated with '\\}' after" } */
13 const char32_t *c = U"\N{ I've just made it up }"; /* { dg-error "'\\\\N\\{' not terminated with '\\}' after" } */
14 const char32_t *d = U"\N{_________ _______}"; /* { dg-error "is not a valid universal character" } */
15 const char32_t *e = U"\N{O.X}"; /* { dg-error "'\\\\N\\{' not terminated with '\\}' after" } */
16 const char32_t *f = U"\N{.}"; /* { dg-error "'\\\\N\\{' not terminated with '\\}' after" } */
17 const char32_t *g = U"\N{BOM}"; /* { dg-error "is not a valid universal character" } */
18 const char32_t *h = U"\N{ZWNBSP}"; /* { dg-error "is not a valid universal character" } */