blob: b561186166c3c391cb8efba9af52f6e2af921421 (
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
34
35
36
37
38
|
/* { dg-do compile } */
/* { dg-options "-std=gnu2y" } */
static int z[0];
static int y[_Countof (z)];
_Static_assert(_Countof (y) == 0);
void
completed (void)
{
int z[] = {};
static_assert (_Countof (z) == 0);
}
void zro_fix (int i,
char (*a)[0][5],
int (*x)[_Countof (*a)],
short (*)[_Generic(x, int (*)[0]: 1)]);
void zro_var (int i,
char (*a)[0][i], /* dg-warn "variable" */
int (*x)[_Countof (*a)],
short (*)[_Generic(x, int (*)[0]: 1)]);
void zro_uns (int i,
char (*a)[0][*],
int (*x)[_Countof (*a)],
short (*)[_Generic(x, int (*)[0]: 1)]);
void
const_expr(void)
{
int n = 7;
_Static_assert (_Countof (int [0][3]) == 0);
_Static_assert (_Countof (int [0]) == 0);
_Static_assert (_Countof (int [0][n]) == 0);
}
|