summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/gnu-cond-expr-2.c
blob: 2e561e4b1de8d46e17dfa4a25f05a23709d92217 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
/* Test diagnostic for GNU extension: omitting middle term of
   conditional expression.  Test with -pedantic.  */
/* Origin: Joseph Myers <joseph@codesourcery.com> */
/* { dg-do compile } */
/* { dg-options "-std=gnu99 -pedantic" } */

int a, b, c;

void
f (void)
{
  c = (++a ? : b); /* { dg-warning "ISO C forbids omitting the middle term of a \\?: expression" } */
}