aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/c2x-constexpr-7.c
blob: 5282d9231821eb39878719b394995cc607dace51 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
/* Test C2x constexpr.  Invalid code, compilation tests, unsigned char.  */
/* { dg-do compile } */
/* { dg-options "-std=c2x -pedantic-errors -funsigned-char" } */

constexpr signed char v2[] = "\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 signed char []) { "\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" } */
}