blob: a52851feddd118cb72dce999fa0c6c4de8330752 [file] [log] [blame]
/* Test C23 constexpr. Invalid code, compilation tests, signed char. */
/* { dg-do compile } */
/* { dg-options "-std=c23 -pedantic-errors -fsigned-char" } */
constexpr unsigned char v3[] = "\x00\xff"; /* { dg-error "'constexpr' initializer not representable in type of object" } */
constexpr char v4[] = u8"\x00\xff"; /* { dg-error "'constexpr' initializer not representable in type of object" } */
constexpr signed char v5[] = u8"\x00\xff"; /* { dg-error "'constexpr' initializer not representable in type of object" } */
void
f0 ()
{
(constexpr unsigned char []) { "\x00\xff" }; /* { dg-error "'constexpr' initializer not representable in type of object" } */
(constexpr char []) { u8"\x00\xff" }; /* { dg-error "'constexpr' initializer not representable in type of object" } */
(constexpr signed char []) { u8"\x00\xff" }; /* { dg-error "'constexpr' initializer not representable in type of object" } */
}