blob: 24e14fa6921057b39fe3d7f985289a316f5d84e8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
/* PR c/108424 */
/* { dg-options "-std=c2x" } */
struct S {
int i;
int : nullptr; /* { dg-error "not an integer constant" } */
};
enum E { X = nullptr }; /* { dg-error "not an integer constant" } */
alignas(nullptr) int g; /* { dg-error "not an integer constant" } */
int arr[10] = { [nullptr] = 1 }; /* { dg-error "not of integer type" } */
_Static_assert (nullptr, "nullptr"); /* { dg-error "not an integer" } */
void f (int n)
{
switch (n) {
case nullptr: /* { dg-error "an integer constant" } */
default:
}
switch (n) {
case 1 ... nullptr: /* { dg-error "an integer constant" } */
default:
}
switch (n) {
case nullptr ... 2: /* { dg-error "an integer constant" } */
default:
}
}
|