summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/cond-lvalue-1.c
blob: f2605af6ad65e859e1e8d87f8663e745fa305027 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
/* Test for deprecation of conditional expressions as lvalues.  */
/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
/* { dg-do compile } */
/* { dg-options "" } */

int x, y, z;

void
foo (void)
{
  (x ? y : z) = 1; /* { dg-bogus "warning" "warning in place of error" } */
}
/* { dg-error "lvalue" "conditional expression as lvalue" { target *-*-* } 11 } */