aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/Wvla-parameter-9.c
blob: 6c8987a34eb0d0323931ea9956e5e5858d986ef7 (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
/* PR c/100550 - ICE: in fold_convert_loc with function call VLA argument
   { dg-do compile }
   { dg-options "-Wall" } */

struct S { int i; };

extern void v;
extern void *pv;
extern struct S s;
void vf (void);

/* Verify that a function redeclaration with an invalid VLA doesn't ICE.  */

void f0 (int[]);
void f0 (int[undeclared]);    // { dg-error "undeclared" }

void f1 (int[]);
void f1 (int[-1]);            // { dg-error "size" }

void f2 (int[]);
void f2 (int[v]);             // { dg-error "size" }

void f3 (int[]);
void f3 (int b[s]);           // { dg-error "size" }

void f4 (int[]);
void f4 (int c[pv]);          // { dg-error "size" }

void f5 (int[]);
void f5 (int d[vf ()]);       // { dg-error "size" }