]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gcc.dg/c2x-constexpr-6.c
a86124a9974c184784f1be3d0298c576a942c65c
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / c2x-constexpr-6.c
1 /* Test C2x constexpr. Invalid code, compilation tests, signed char. */
2 /* { dg-do compile } */
3 /* { dg-options "-std=c2x -pedantic-errors -fsigned-char" } */
4
5 constexpr unsigned char v3[] = "\x00\xff"; /* { dg-error "'constexpr' initializer not representable in type of object" } */
6 constexpr char v4[] = u8"\x00\xff"; /* { dg-error "'constexpr' initializer not representable in type of object" } */
7 constexpr signed char v5[] = u8"\x00\xff"; /* { dg-error "'constexpr' initializer not representable in type of object" } */
8
9 void
10 f0 ()
11 {
12 (constexpr unsigned char []) { "\x00\xff" }; /* { dg-error "'constexpr' initializer not representable in type of object" } */
13 (constexpr char []) { u8"\x00\xff" }; /* { dg-error "'constexpr' initializer not representable in type of object" } */
14 (constexpr signed char []) { u8"\x00\xff" }; /* { dg-error "'constexpr' initializer not representable in type of object" } */
15 }