call.c (build_conditional_expr): Fix typo.
* call.c (build_conditional_expr): Fix typo. * typeck.c (build_modify_expr, COND_EXPR): Make sure we've got an lvalue before trying to mess with the sides. * error.c (dump_expr, CONVERT_EXPR): Handle (void) properly. From-SVN: r28826
This commit is contained in:
parent
2ac84cfe01
commit
df39af7db0
4 changed files with 32 additions and 8 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
1999-08-24 Jason Merrill <jason@yorick.cygnus.com>
|
||||||
|
|
||||||
|
* call.c (build_conditional_expr): Fix typo.
|
||||||
|
* typeck.c (build_modify_expr, COND_EXPR): Make sure we've got an
|
||||||
|
lvalue before trying to mess with the sides.
|
||||||
|
|
||||||
|
* error.c (dump_expr, CONVERT_EXPR): Handle (void) properly.
|
||||||
|
|
||||||
Mon Aug 23 22:17:20 1999 Mumit Khan <khan@xraylith.wisc.edu>
|
Mon Aug 23 22:17:20 1999 Mumit Khan <khan@xraylith.wisc.edu>
|
||||||
|
|
||||||
* g++spec.c (lang_specific_driver): Add room for NULL in arglist.
|
* g++spec.c (lang_specific_driver): Add room for NULL in arglist.
|
||||||
|
|
|
@ -2825,7 +2825,7 @@ build_conditional_expr (arg1, arg2, arg3)
|
||||||
if ((TREE_CODE (arg2) == THROW_EXPR)
|
if ((TREE_CODE (arg2) == THROW_EXPR)
|
||||||
^ (TREE_CODE (arg3) == THROW_EXPR))
|
^ (TREE_CODE (arg3) == THROW_EXPR))
|
||||||
result_type = ((TREE_CODE (arg2) == THROW_EXPR)
|
result_type = ((TREE_CODE (arg2) == THROW_EXPR)
|
||||||
? arg2_type : arg3_type);
|
? arg3_type : arg2_type);
|
||||||
else if (arg2_void_p && arg3_void_p)
|
else if (arg2_void_p && arg3_void_p)
|
||||||
result_type = void_type_node;
|
result_type = void_type_node;
|
||||||
else
|
else
|
||||||
|
|
|
@ -1547,7 +1547,13 @@ dump_expr (t, nop)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CONVERT_EXPR:
|
case CONVERT_EXPR:
|
||||||
dump_unary_op ("+", t, nop);
|
if (same_type_p (TREE_TYPE (t), void_type_node))
|
||||||
|
{
|
||||||
|
OB_PUTS ("(void)");
|
||||||
|
dump_expr (TREE_OPERAND (t, 0), 0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
dump_unary_op ("+", t, nop);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ADDR_EXPR:
|
case ADDR_EXPR:
|
||||||
|
|
|
@ -5734,12 +5734,22 @@ build_modify_expr (lhs, modifycode, rhs)
|
||||||
/* Produce (a ? (b = rhs) : (c = rhs))
|
/* Produce (a ? (b = rhs) : (c = rhs))
|
||||||
except that the RHS goes through a save-expr
|
except that the RHS goes through a save-expr
|
||||||
so the code to compute it is only emitted once. */
|
so the code to compute it is only emitted once. */
|
||||||
tree cond
|
tree cond;
|
||||||
= build_conditional_expr (TREE_OPERAND (lhs, 0),
|
|
||||||
build_modify_expr (cp_convert (TREE_TYPE (lhs), TREE_OPERAND (lhs, 1)),
|
/* Check this here to avoid odd errors when trying to convert
|
||||||
modifycode, rhs),
|
a throw to the type of the COND_EXPR. */
|
||||||
build_modify_expr (cp_convert (TREE_TYPE (lhs), TREE_OPERAND (lhs, 2)),
|
if (!lvalue_or_else (lhs, "assignment"))
|
||||||
modifycode, rhs));
|
return error_mark_node;
|
||||||
|
|
||||||
|
cond = build_conditional_expr
|
||||||
|
(TREE_OPERAND (lhs, 0),
|
||||||
|
build_modify_expr (cp_convert (TREE_TYPE (lhs),
|
||||||
|
TREE_OPERAND (lhs, 1)),
|
||||||
|
modifycode, rhs),
|
||||||
|
build_modify_expr (cp_convert (TREE_TYPE (lhs),
|
||||||
|
TREE_OPERAND (lhs, 2)),
|
||||||
|
modifycode, rhs));
|
||||||
|
|
||||||
if (cond == error_mark_node)
|
if (cond == error_mark_node)
|
||||||
return cond;
|
return cond;
|
||||||
/* Make sure the code to compute the rhs comes out
|
/* Make sure the code to compute the rhs comes out
|
||||||
|
|
Loading…
Add table
Reference in a new issue