]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/4933 (tree_list not supported by dump_expr)
authorGiovanni Bajo <giovannibajo@libero.it>
Mon, 30 Jun 2003 19:22:48 +0000 (21:22 +0200)
committerWolfgang Bangerth <bangerth@gcc.gnu.org>
Mon, 30 Jun 2003 19:22:48 +0000 (13:22 -0600)
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

gcc/cp/ChangeLog
gcc/cp/error.c

index 01acce93f4765ceab86b5e48414795607652cb89..9289d6770874c7ab4c9f18b12bcda4dadff92907 100644 (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
index c687299d32f4c90d97d6bef6de6b361c3dcdb741..4cb5ba4173c9126ac1e1f846ddd6d38cff7ce2a5 100644 (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;