blob: 176f400ce3716fe89213c0309ba80c219ac07558 [file] [log] [blame]
/* PR101838 */
/* { dg-do run } */
/* { dg-options "-Wpedantic -O0" } */
int bar0(
int (*a)[*],
int (*b)[sizeof(*a)]
);
int bar(
struct f { /* { dg-warning "will not be visible outside of this definition" } */
int a[*]; } v, /* { dg-warning "variably modified type" } */
int (*b)[sizeof(struct f)] // should not warn about zero size
);
int foo(void)
{
int n = 0;
return sizeof(typeof(*({ n = 10; struct foo { /* { dg-warning "braced-groups" } */
int x[n]; /* { dg-warning "variably modified type" } */
} x; &x; })));
}
int main()
{
if (sizeof(struct foo { int x[10]; }) != foo())
__builtin_abort();
return 0;
}