aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Pinski <andrew_pinski@playstation.sony.com>2007-05-09 00:46:11 +0000
committerAndrew Pinski <pinskia@gcc.gnu.org>2007-05-08 17:46:11 -0700
commitee72fa38841b7da8c16bef043b462595ec3b7ac9 (patch)
tree0ff299e37d46040085280897ace784e290b27479
parent8e34b5db9ed5a30ce1855d95195a301463ef4f6f (diff)
downloadgcc-ee72fa38841b7da8c16bef043b462595ec3b7ac9.zip
gcc-ee72fa38841b7da8c16bef043b462595ec3b7ac9.tar.gz
gcc-ee72fa38841b7da8c16bef043b462595ec3b7ac9.tar.bz2
typeck.c (build_unary_op): Remove code that used to handle non lvalue increments/decrements.
2007-05-07 Andrew Pinski <andrew_pinski@playstation.sony.com> * typeck.c (build_unary_op): Remove code that used to handle non lvalue increments/decrements. From-SVN: r124564
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/typeck.c35
2 files changed, 5 insertions, 35 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index e0286ff..708da19 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2007-05-07 Andrew Pinski <andrew_pinski@playstation.sony.com>
+
+ * typeck.c (build_unary_op): Remove code that used to
+ handle non lvalue increments/decrements.
+
2007-05-07 Mike Stump <mrs@apple.com>
* parser.c (check_empty_body): Add.
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index 2b4e065..08b5b7e 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -4278,41 +4278,6 @@ build_unary_op (enum tree_code code, tree xarg, int noconvert)
inc = cp_convert (argtype, inc);
- /* Handle incrementing a cast-expression. */
-
- switch (TREE_CODE (arg))
- {
- case NOP_EXPR:
- case CONVERT_EXPR:
- case FLOAT_EXPR:
- case FIX_TRUNC_EXPR:
- {
- tree incremented, modify, value, compound;
- if (! lvalue_p (arg) && pedantic)
- pedwarn ("cast to non-reference type used as lvalue");
- arg = stabilize_reference (arg);
- if (code == PREINCREMENT_EXPR || code == PREDECREMENT_EXPR)
- value = arg;
- else
- value = save_expr (arg);
- incremented = build2 (((code == PREINCREMENT_EXPR
- || code == POSTINCREMENT_EXPR)
- ? PLUS_EXPR : MINUS_EXPR),
- argtype, value, inc);
-
- modify = build_modify_expr (arg, NOP_EXPR, incremented);
- compound = build2 (COMPOUND_EXPR, TREE_TYPE (arg),
- modify, value);
-
- /* Eliminate warning about unused result of + or -. */
- TREE_NO_WARNING (compound) = 1;
- return compound;
- }
-
- default:
- break;
- }
-
/* Complain about anything else that is not a true lvalue. */
if (!lvalue_or_else (arg, ((code == PREINCREMENT_EXPR
|| code == POSTINCREMENT_EXPR)