diff options
author | Joseph Myers <jsm@polyomino.org.uk> | 2003-11-05 17:53:04 +0000 |
---|---|---|
committer | Joseph Myers <jsm28@gcc.gnu.org> | 2003-11-05 17:53:04 +0000 |
commit | 0a49d02ccb882d750c5197c82ff6a19957fce294 (patch) | |
tree | 4bea129d1bd8ed20bd84ac70ac8027d3ce61a527 /gcc/testsuite | |
parent | db9fd03ea1d98dfcabe2c0369d000094bd4dd686 (diff) | |
download | gcc-0a49d02ccb882d750c5197c82ff6a19957fce294.zip gcc-0a49d02ccb882d750c5197c82ff6a19957fce294.tar.gz gcc-0a49d02ccb882d750c5197c82ff6a19957fce294.tar.bz2 |
c-typeck.c (pedantic_lvalue_warning): Deprecate use of conditional expressions as lvalues.
* c-typeck.c (pedantic_lvalue_warning): Deprecate use of
conditional expressions as lvalues.
testsuite:
* gcc.dg/cond-lvalue-1.c: New test.
From-SVN: r73273
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/cond-lvalue-1.c | 12 |
2 files changed, 16 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 7420ded..87302ad 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2003-11-05 Joseph S. Myers <jsm@polyomino.org.uk> + + * gcc.dg/cond-lvalue-1.c: New test. + 2003-11-05 Gernot Hillier <gernot.hillier@siemens.com> * g++.old-deja/g++.pt/asm1.C: Enable for e.g. x86_64-*-linux-gnu. diff --git a/gcc/testsuite/gcc.dg/cond-lvalue-1.c b/gcc/testsuite/gcc.dg/cond-lvalue-1.c new file mode 100644 index 0000000..1765546 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cond-lvalue-1.c @@ -0,0 +1,12 @@ +/* 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-warning "lvalue" "conditional expression as lvalue deprecated" } */ +} |