2006-08-05 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+ PR c/27721
+ * c-typeck.c (build_modify_expr): Test earlier for non-lvalues.
+
PR c/28136
* c-parser.c (c_parser_postfix_expression_after_paren_type): Robustify.
if (TREE_CODE (lhs) == ERROR_MARK || TREE_CODE (rhs) == ERROR_MARK)
return error_mark_node;
+ if (!lvalue_or_else (lhs, lv_assign))
+ return error_mark_node;
+
STRIP_TYPE_NOPS (rhs);
newrhs = rhs;
newrhs = build_binary_op (modifycode, lhs, rhs, 1);
}
- if (!lvalue_or_else (lhs, lv_assign))
- return error_mark_node;
-
/* Give an error for storing in something that is 'const'. */
if (TREE_READONLY (lhs) || TYPE_READONLY (lhstype)