1 /* PR c/92326 - wrong bound in zero-length array diagnostics
3 { dg-options "-O2 -Wall" } */
8 void warn_global_array (void)
10 a0
[0] = 0; // { dg-warning "array bounds of 'int *\\\[0]'" }
11 ax
[-1] = 0; // { dg-warning "array bounds of 'int *\\\[]'" }
15 struct S0
{ int n
, a0
[0]; } s0
;
16 struct Sx
{ int n
, ax
[]; } sx
= { 0 };
18 void warn_member_array (void)
20 s0
.a0
[0] = 0; // { dg-warning "array bounds of 'int *\\\[0]'" }
21 sx
.ax
[0] = 0; // { dg-warning "array bounds of 'int *\\\[]'" }