diff options
author | Giovanni Bajo <giovannibajo@libero.it> | 2003-06-30 21:22:48 +0200 |
---|---|---|
committer | Wolfgang Bangerth <bangerth@gcc.gnu.org> | 2003-06-30 13:22:48 -0600 |
commit | 4497827651d07fa10006fbac4cf63a92cf83c2a2 (patch) | |
tree | 82de458f43dd339de67bd1922f0807a9bdb893ca | |
parent | c85e18ee682b48bba948aa5a4fec9d1f12a5c456 (diff) | |
download | gcc-4497827651d07fa10006fbac4cf63a92cf83c2a2.zip gcc-4497827651d07fa10006fbac4cf63a92cf83c2a2.tar.gz gcc-4497827651d07fa10006fbac4cf63a92cf83c2a2.tar.bz2 |
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
-rw-r--r-- | gcc/cp/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/cp/error.c | 19 |
2 files changed, 22 insertions, 4 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 01acce9..9289d67 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,12 @@ 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 mangle a CALL_EXPR. diff --git a/gcc/cp/error.c b/gcc/cp/error.c index c687299..4cb5ba4 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -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; |