+2008-04-29 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/35987
+ * typeck.c (cp_build_modify_expr) <case PREINCREMENT_EXPR>: Don't build
+ COMPOUND_EXPR if the second argument would be error_mark_node.
+
2008-04-28 Jason Merrill <jason@redhat.com>
Liu Guanwei <liu_gw@163.com>
lhs = build2 (TREE_CODE (lhs), TREE_TYPE (lhs),
stabilize_reference (TREE_OPERAND (lhs, 0)),
TREE_OPERAND (lhs, 1));
- return build2 (COMPOUND_EXPR, lhstype,
- lhs,
- cp_build_modify_expr (TREE_OPERAND (lhs, 0),
- modifycode, rhs, complain));
+ newrhs = cp_build_modify_expr (TREE_OPERAND (lhs, 0),
+ modifycode, rhs, complain);
+ if (newrhs == error_mark_node)
+ return error_mark_node;
+ return build2 (COMPOUND_EXPR, lhstype, lhs, newrhs);
/* Handle (a, b) used as an "lvalue". */
case COMPOUND_EXPR: