aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/c2x-constexpr-5.c
blob: 5899ca1b11e32b1395cee59fa06e57f5e9837f41 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* Test C23 constexpr.  Valid code, compilation tests, unsigned char.  */
/* { dg-do compile } */
/* { dg-options "-std=c23 -pedantic-errors -funsigned-char" } */

constexpr char v1[] = "\x00\xff";
constexpr signed char v2[] = "\x7f\x00";
constexpr unsigned char v3[] = "\x80\x7f";
constexpr char v4[] = u8"\x00\xff";
constexpr signed char v5[] = u8"\x7f\x00";
constexpr unsigned char v6[] = u8"\x00\xff";

void
f0 ()
{
  (constexpr char []) { "\x00\xff" };
  (constexpr signed char []) { "\x7f\x00" };
  (constexpr unsigned char []) { "\x80\x7f" };
  (constexpr char []) { u8"\x00\xff" };
  (constexpr signed char []) { u8"\x7f\x00" };
  (constexpr unsigned char []) { u8"\x00\xff" };
}