libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / c11-fordecl-2.c
blob0be1a0d13fa269753b1c232dae794b6c0514662c
1 /* Test for C99 declarations in for loops. Test constraints are diagnosed for
2 C11: struct and union tags can't be declared there (affirmed in response to
3 DR#277). Based on c99-fordecl-3.c. */
4 /* { dg-do compile } */
5 /* { dg-options "-std=c11 -pedantic-errors" } */
7 void
8 foo (void)
10 for (struct s { int p; } *p = 0; ;) /* { dg-error "'struct s' declared in 'for' loop initial declaration" } */
12 for (union u { int p; } *p = 0; ;) /* { dg-error "'union u' declared in 'for' loop initial declaration" } */