blob: 39c806246c060f6c461eb5b901b95ae61e7f258d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
/* P2071R2 - Named universal character escapes */
/* { dg-do compile } */
/* { dg-require-effective-target wchar } */
/* { dg-options "-std=gnu99 -Wno-c++-compat" { target c } } */
/* { dg-options "-std=c++23" { target c++ } } */
#ifndef __cplusplus
typedef __CHAR32_TYPE__ char32_t;
#endif
const char32_t *a = U"\N{}"; /* { dg-error "empty named universal character escape sequence" } */
const char32_t *b = U"\N{NU" "LL}"; /* { dg-error "'\\\\N\\{' not terminated with '\\}' after" } */
const char32_t *c = U"\N{ I've just made it up }"; /* { dg-error "'\\\\N\\{' not terminated with '\\}' after" } */
const char32_t *d = U"\N{_________ _______}"; /* { dg-error "is not a valid universal character" } */
const char32_t *e = U"\N{O.X}"; /* { dg-error "'\\\\N\\{' not terminated with '\\}' after" } */
const char32_t *f = U"\N{.}"; /* { dg-error "'\\\\N\\{' not terminated with '\\}' after" } */
const char32_t *g = U"\N{BOM}"; /* { dg-error "is not a valid universal character" } */
const char32_t *h = U"\N{ZWNBSP}"; /* { dg-error "is not a valid universal character" } */
|