| 1 |
/* |
| 2 |
* { dg-do compile } |
| 3 |
* { dg-options "-Wno-vla -std=gnu23" } |
| 4 |
*/ |
| 5 |
|
| 6 |
// arrays in structs |
| 7 |
|
| 8 |
void foo(int n, int m) |
| 9 |
{ |
| 10 |
struct f { int b; int a[n]; }; |
| 11 |
struct f { int b; int a[n]; }; /* { dg-error "redefinition of struct or union" } */ |
| 12 |
struct f { int b; int a[m]; }; /* { dg-error "redefinition of struct or union" } */ |
| 13 |
struct f { int b; int a[5]; }; /* { dg-error "redefinition of struct or union" } */ |
| 14 |
struct f { int b; int a[]; }; /* { dg-error "redefinition of struct or union" } */ |
| 15 |
|
| 16 |
struct g { int a[n]; int b; }; |
| 17 |
struct g { int a[n]; int b; }; /* { dg-error "redefinition of struct or union" } */ |
| 18 |
struct g { int a[m]; int b; }; /* { dg-error "redefinition of struct or union" } */ |
| 19 |
struct g { int a[4]; int b; }; /* { dg-error "redefinition of struct or union" } */ |
| 20 |
|
| 21 |
struct h { int (*a)[n]; int b; }; |
| 22 |
struct h { int (*a)[n]; int b; }; /* { dg-error "redefinition of struct or union" } */ |
| 23 |
struct h { int (*a)[m]; int b; }; /* { dg-error "redefinition of struct or union" } */ |
| 24 |
struct h { int (*a)[4]; int b; }; /* { dg-error "redefinition of struct or union" } */ |
| 25 |
struct h { int (*a)[]; int b; }; /* { dg-error "redefinition of struct or union" } */ |
| 26 |
} |
| 27 |
|
| 28 |
|