diff options
author | bangerth <bangerth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-06-30 19:22:48 +0000 |
---|---|---|
committer | bangerth <bangerth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-06-30 19:22:48 +0000 |
commit | ab2795ac64e7092e19f85ba5d9b99f035f8e644b (patch) | |
tree | 82de458f43dd339de67bd1922f0807a9bdb893ca /gcc/cp/error.c | |
parent | 8ad28085e925c58aedeacf0340772128241c60c5 (diff) | |
download | ppe42-gcc-ab2795ac64e7092e19f85ba5d9b99f035f8e644b.tar.gz ppe42-gcc-ab2795ac64e7092e19f85ba5d9b99f035f8e644b.zip |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@68733 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/error.c')
-rw-r--r-- | gcc/cp/error.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/gcc/cp/error.c b/gcc/cp/error.c index c687299d32f..4cb5ba4173c 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; |