| 1 |
// CWG 2691 - hexadecimal-escape-sequence is too greedy |
| 2 |
/* { dg-do run } */ |
| 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 |
#include <wchar.h> |
| 9 |
typedef __CHAR16_TYPE__ char16_t; |
| 10 |
typedef __CHAR32_TYPE__ char32_t; |
| 11 |
#endif |
| 12 |
|
| 13 |
const char32_t *a = U"\x{20}ab"; |
| 14 |
|
| 15 |
int |
| 16 |
main () |
| 17 |
{ |
| 18 |
if (a[0] != U'\x20' || a[1] != U'a' || a[2] != U'b' || a[3] != U'\0') |
| 19 |
__builtin_abort (); |
| 20 |
} |