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