re PR c++/4933 (tree_list not supported by dump_expr)

2003-06-30  Giovanni Bajo  <giovannibajo@libero.it>

        PR c++/4933
        * error.c (dump_expr): Support correctly the COMPOUND_EXPR
        tree generated within a template. Use dump_expr to dump an
        expression sizeof.

From-SVN: r68733
This commit is contained in:
Giovanni Bajo 2003-06-30 21:22:48 +02:00 committed by Wolfgang Bangerth
parent c85e18ee68
commit 4497827651
2 changed files with 22 additions and 4 deletions

View File

@ -1,3 +1,10 @@
2003-06-30 Giovanni Bajo <giovannibajo@libero.it>
PR c++/4933
* error.c (dump_expr): Support correctly the COMPOUND_EXPR
tree generated within a template. Use dump_expr to dump an
expression sizeof.
2003-06-30 Giovanni Bajo <giovannibajo@libero.it>
* mangle.c (write_expression): Exit gracefully when trying to

View File

@ -1506,9 +1506,20 @@ dump_expr (tree t, int flags)
case COMPOUND_EXPR:
print_left_paren (scratch_buffer);
dump_expr (TREE_OPERAND (t, 0), flags | TFF_EXPR_IN_PARENS);
separate_with_comma (scratch_buffer);
dump_expr (TREE_OPERAND (t, 1), flags | TFF_EXPR_IN_PARENS);
/* Within templates, a COMPOUND_EXPR has only one operand,
containing a TREE_LIST of the two operands. */
if (TREE_CODE (TREE_OPERAND (t, 0)) == TREE_LIST)
{
if (TREE_OPERAND (t, 1))
abort();
dump_expr_list (TREE_OPERAND (t, 0), flags | TFF_EXPR_IN_PARENS);
}
else
{
dump_expr (TREE_OPERAND (t, 0), flags | TFF_EXPR_IN_PARENS);
separate_with_comma (scratch_buffer);
dump_expr (TREE_OPERAND (t, 1), flags | TFF_EXPR_IN_PARENS);
}
print_right_paren (scratch_buffer);
break;
@ -1956,7 +1967,7 @@ dump_expr (tree t, int flags)
if (TYPE_P (TREE_OPERAND (t, 0)))
dump_type (TREE_OPERAND (t, 0), flags);
else
dump_unary_op ("*", t, flags | TFF_EXPR_IN_PARENS);
dump_expr (TREE_OPERAND (t, 0), flags);
print_right_paren (scratch_buffer);
break;