aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorAndrew Pinski <andrew_pinski@playstation.sony.com>2007-08-17 22:14:47 +0000
committerAndrew Pinski <pinskia@gcc.gnu.org>2007-08-17 15:14:47 -0700
commit8f4361eb9f1c0fc24e49cb482b35874320043370 (patch)
tree5c639966a9d46c89da269609ea2c6dd0aab42506 /gcc/cp
parent279e32c924988609c7b48d70b681b492a142b66a (diff)
downloadgcc-8f4361eb9f1c0fc24e49cb482b35874320043370.zip
gcc-8f4361eb9f1c0fc24e49cb482b35874320043370.tar.gz
gcc-8f4361eb9f1c0fc24e49cb482b35874320043370.tar.bz2
re PR c++/28989 (post-increment of bool variable accepted as lvalue)
2007-08-17 Andrew Pinski <andrew_pinski@playstation.sony.com> PR c++/28989 * tree.c (lvalue_p_1 <case SAVE_EXPR>): SAVE_EXPRs are never lvalues. 2007-08-17 Andrew Pinski <andrew_pinski@playstation.sony.com> PR c++/28989 * g++.dg/expr/lval3.C: New test. * g++.dg/expr/lval4.C: New test. From-SVN: r127603
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/tree.c3
2 files changed, 8 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 9556496..3fd17c4 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2007-08-17 Andrew Pinski <andrew_pinski@playstation.sony.com>
+
+ PR c++/28989
+ * tree.c (lvalue_p_1 <case SAVE_EXPR>): SAVE_EXPRs are never
+ lvalues.
+
2007-08-17 Ollie Wild <aaw@google.com>
PR c++/31749
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 792f1fd..1d16f2c 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -92,11 +92,12 @@ lvalue_p_1 (tree ref,
switch (TREE_CODE (ref))
{
+ case SAVE_EXPR:
+ return clk_none;
/* preincrements and predecrements are valid lvals, provided
what they refer to are valid lvals. */
case PREINCREMENT_EXPR:
case PREDECREMENT_EXPR:
- case SAVE_EXPR:
case TRY_CATCH_EXPR:
case WITH_CLEANUP_EXPR:
case REALPART_EXPR: