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

int x, y, z;

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