| 1 |
/* PR c/100550 - ICE: in fold_convert_loc with function call VLA argument |
| 2 |
{ dg-do compile } |
| 3 |
{ dg-options "-Wall" } */ |
| 4 |
|
| 5 |
struct S { int i; }; |
| 6 |
|
| 7 |
extern void v; |
| 8 |
extern void *pv; |
| 9 |
extern struct S s; |
| 10 |
void vf (void); |
| 11 |
|
| 12 |
/* Verify that a function redeclaration with an invalid VLA doesn't ICE. */ |
| 13 |
|
| 14 |
void f0 (int[]); |
| 15 |
void f0 (int[undeclared]); // { dg-error "undeclared" } |
| 16 |
|
| 17 |
void f1 (int[]); |
| 18 |
void f1 (int[-1]); // { dg-error "size" } |
| 19 |
|
| 20 |
void f2 (int[]); |
| 21 |
void f2 (int[v]); // { dg-error "size" } |
| 22 |
|
| 23 |
void f3 (int[]); |
| 24 |
void f3 (int b[s]); // { dg-error "size" } |
| 25 |
|
| 26 |
void f4 (int[]); |
| 27 |
void f4 (int c[pv]); // { dg-error "size" } |
| 28 |
|
| 29 |
void f5 (int[]); |
| 30 |
void f5 (int d[vf ()]); // { dg-error "size" } |