1 /* PR101838 */
2 /* { dg-do run } */
3 /* { dg-options "-Wpedantic -O0" } */
4 /* { dg-require-effective-target alloca } */
5
6
7 int bar0(
8 int (*a)[*],
9 int (*b)[sizeof(*a)]
10 );
11
12
13 int bar(
14 struct f { /* { dg-warning "will not be visible outside of this definition" } */
15 int a[*]; } v, /* { dg-warning "variably modified type" } */
16 int (*b)[sizeof(struct f)] // should not warn about zero size
17 );
18
19 int foo(void)
20 {
21 int n = 0;
22 return sizeof(typeof(*({ n = 10; struct foo { /* { dg-warning "braced-groups" } */
23 int x[n]; /* { dg-warning "variably modified type" } */
24 } x; &x; })));
25 }
26
27
28 int main()
29 {
30 if (sizeof(struct foo { int x[10]; }) != foo())
31 __builtin_abort();
32
33 return 0;
34 }