error.c (dump_expr): Clean up NEW_EXPR case.
authorJason Merrill <jason@gcc.gnu.org>
Thu, 4 Jun 1998 01:33:03 +0000 (21:33 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Thu, 4 Jun 1998 01:33:03 +0000 (21:33 -0400)
* error.c (dump_expr): Clean up NEW_EXPR case.
* tree.c (mapcar): Support NEW_EXPR.
* error.c (dump_expr): Support NEW_EXPR.
* decl2.c (arg_assoc_type): Return 0 for LANG_TYPE.

From-SVN: r20218

gcc/cp/ChangeLog
gcc/cp/decl2.c
gcc/cp/error.c
gcc/cp/tree.c

index 6f115d65c1029962aa18b416a95235ebfe5cdd5f..d14af595478548a67bfc3aac3186a4d1fd629b89 100644 (file)
@@ -1,3 +1,17 @@
+1998-06-04  Jason Merrill  <jason@yorick.cygnus.com>
+
+       * error.c (dump_expr): Clean up NEW_EXPR case.
+
+1998-06-04  Martin von Löwis  <loewis@informatik.hu-berlin.de>
+
+       * tree.c (mapcar): Support NEW_EXPR.
+
+       * error.c (dump_expr): Support NEW_EXPR.
+
+1998-06-04  Jason Merrill  <jason@yorick.cygnus.com>
+
+       * decl2.c (arg_assoc_type): Return 0 for LANG_TYPE.
+
 1998-06-03  Jason Merrill  <jason@yorick.cygnus.com>
 
        * method.c (make_thunk): Use overload machinery to make name.
index 77aaa2b7c0c563cf01e58fa1082d76b435b70192..dc800da4b8514af9448590412b8bf3759a611bab 100644 (file)
@@ -4208,6 +4208,7 @@ arg_assoc_type (k, type)
     case COMPLEX_TYPE:
     case CHAR_TYPE:
     case BOOLEAN_TYPE:
+    case LANG_TYPE:
       return 0;
     case RECORD_TYPE:
       if (TYPE_PTRMEMFUNC_P (type))
index 9202b3911c37fa10c1c467986f2b904885d435d2..75194615bdf644d90f33cc77675ce5382e0e70c4 100644 (file)
@@ -1341,6 +1341,33 @@ dump_expr (t, nop)
       }
       break;
 
+    case NEW_EXPR:
+      {
+       tree type = TREE_OPERAND (t, 1);
+       if (NEW_EXPR_USE_GLOBAL (t))
+         OB_PUTS ("::");
+       OB_PUTS ("new ");
+       if (TREE_OPERAND (t, 0))
+         {
+           OB_PUTC ('(');
+           dump_expr_list (TREE_OPERAND (t, 0));
+           OB_PUTS (") ");
+         }
+       if (TREE_CODE (type) == ARRAY_REF)
+         type = build_cplus_array_type
+           (TREE_OPERAND (type, 0),
+            build_index_type (size_binop (MINUS_EXPR, TREE_OPERAND (type, 1),
+                                          integer_one_node)));
+       dump_type (type, 0);
+       if (TREE_OPERAND (t, 2))
+         {
+           OB_PUTC ('(');
+           dump_expr_list (TREE_OPERAND (t, 2));
+           OB_PUTC (')');
+         }
+      }
+      break;
+
     case TARGET_EXPR:
       /* Note that this only works for G++ target exprs.  If somebody
         builds a general TARGET_EXPR, there's no way to represent that
index de15c07953f6e3536c74fe7d559d65a924fe1ca4..685645a846912f724d5c589e440fb0102fe2a3bf 100644 (file)
@@ -1754,6 +1754,13 @@ mapcar (t, func)
       TREE_OPERAND (t, 2) = NULL_TREE;
       return t;
 
+    case NEW_EXPR:
+      t = copy_node (t);
+      TREE_OPERAND (t, 0) = mapcar (TREE_OPERAND (t, 0), func);
+      TREE_OPERAND (t, 1) = mapcar (TREE_OPERAND (t, 1), func);
+      TREE_OPERAND (t, 2) = mapcar (TREE_OPERAND (t, 2), func);
+      return t;
+
     case RECORD_TYPE:
       if (TYPE_PTRMEMFUNC_P (t))
        return build_ptrmemfunc_type