Debian Codegraph @

gcc/testsuite/gcc.dg/c23-if-decls-1.c

raw
1 /* N3356 - if declarations. */
2 /* PR c/117019 */
3 /* { dg-do compile } */
4 /* { dg-options "-std=c23 -pedantic-errors" } */
5
6 void
7 g ()
8 {
9 if (int i = 42); /* { dg-error "ISO C does not support if declarations before C2Y" } */
10 if (int i = 42; i > 10); /* { dg-error "ISO C does not support if declarations before C2Y" } */
11 if (int i, j; i = 42); /* { dg-error "ISO C does not support if declarations before C2Y" } */
12 switch (int i = 42); /* { dg-error "ISO C does not support if declarations before C2Y" } */
13 switch (int i = 42; i); /* { dg-error "ISO C does not support if declarations before C2Y" } */
14 switch (int i, j; i = 42); /* { dg-error "ISO C does not support if declarations before C2Y" } */
15 }