aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/gnu99-if-decls-1.c
blob: 6d7a3bc196b415a9b59286c6307c784564cac7db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* N3356 - if declarations.  */
/* PR c/117019 */
/* { dg-do compile } */
/* { dg-options "-std=gnu99 -Wpedantic" } */

void
g ()
{
  if (int i = 42);		/* { dg-warning "ISO C does not support if declarations before C2Y" } */
  if (int i = 42; i > 10);	/* { dg-warning "ISO C does not support if declarations before C2Y" } */
  if (int i, j; i = 42);	/* { dg-warning "ISO C does not support if declarations before C2Y" } */
  switch (int i = 42);		/* { dg-warning "ISO C does not support if declarations before C2Y" } */
  switch (int i = 42; i);	/* { dg-warning "ISO C does not support if declarations before C2Y" } */
  switch (int i, j; i = 42);	/* { dg-warning "ISO C does not support if declarations before C2Y" } */
}