| 1 |
/* Test for constraints on constant expressions. In C90 it is clear that |
| 2 |
certain constructs are not permitted in unevaluated parts of an |
| 3 |
expression (except in sizeof); in C99 it might fall within implementation |
| 4 |
latitude; and if the operands are suitable, diagnostics should not be |
| 5 |
issued. |
| 6 |
*/ |
| 7 |
/* Origin: Joseph Myers <[email protected]>; inspired by |
| 8 |
http://deja.com/getdoc.xp?AN=524271595&fmt=text by Peter Seebach. |
| 9 |
*/ |
| 10 |
/* { dg-do compile } */ |
| 11 |
/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */ |
| 12 |
|
| 13 |
/* The comma operator is in a subexpression that is not evaluated, so OK |
| 14 |
by C99. In C90 a diagnostic is required since it is not in a sizeof. |
| 15 |
*/ |
| 16 |
int i = (1 ? 0 : (2, 3)); |