]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/gcc.dg/vla-stexp-2.c
Update copyright years.
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / vla-stexp-2.c
CommitLineData
d2ba65ab
MU
1/* PR101838 */
2/* { dg-do run } */
3/* { dg-options "-Wpedantic -O0" } */
4
5
6int bar0(
7 int (*a)[*],
8 int (*b)[sizeof(*a)]
9);
10
11
12int bar(
13 struct f { /* { dg-warning "will not be visible outside of this definition" } */
14 int a[*]; } v, /* { dg-warning "variably modified type" } */
15 int (*b)[sizeof(struct f)] // should not warn about zero size
16);
17
18int foo(void)
19{
20 int n = 0;
21 return sizeof(typeof(*({ n = 10; struct foo { /* { dg-warning "braced-groups" } */
22 int x[n]; /* { dg-warning "variably modified type" } */
23 } x; &x; })));
24}
25
26
27int main()
28{
29 if (sizeof(struct foo { int x[10]; }) != foo())
30 __builtin_abort();
31
32 return 0;
33}