call.c (build_conv): Don't use build1 for USER_CONV.
authorMark Mitchell <mmitchel@gcc.gnu.org>
Thu, 4 Jan 2001 19:28:56 +0000 (19:28 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Thu, 4 Jan 2001 19:28:56 +0000 (19:28 +0000)
* call.c (build_conv): Don't use build1 for USER_CONV.
* pt.c (tsubst_copy): Or for PREINCREMENT_EXPR and similar nodes.

From-SVN: r38688

gcc/cp/call.c
gcc/cp/pt.c

index 3c1f9aa245ba2162980972bc17178d3e8314f66b..0c08d18af4ca0f113fd1ef81ca5d1748d24198e3 100644 (file)
@@ -605,8 +605,16 @@ build_conv (code, type, from)
      enum tree_code code;
      tree type, from;
 {
-  tree t = build1 (code, type, from);
+  tree t;
   int rank = ICS_STD_RANK (from);
+
+  /* We can't use buidl1 here because CODE could be USER_CONV, which
+     takes two arguments.  In that case, the caller is responsible for
+     filling in the second argument.  */
+  t = make_node (code);
+  TREE_TYPE (t) = type;
+  TREE_OPERAND (t, 0) = from;
+
   switch (code)
     {
     case PTR_CONV:
index e838a9807b8328f9ab1f42eda7e14b7b0b23f6f6..ecf201a07832b64b0aea3ad9edc8a5f6984ae795 100644 (file)
@@ -6892,10 +6892,6 @@ tsubst_copy (t, args, complain, in_decl)
         tsubst_copy (TREE_OPERAND (t, 0), args, complain, in_decl));
 
     case INDIRECT_REF:
-    case PREDECREMENT_EXPR:
-    case PREINCREMENT_EXPR:
-    case POSTDECREMENT_EXPR:
-    case POSTINCREMENT_EXPR:
     case NEGATE_EXPR:
     case TRUTH_NOT_EXPR:
     case BIT_NOT_EXPR:
@@ -6948,6 +6944,10 @@ tsubst_copy (t, args, complain, in_decl)
     case SCOPE_REF:
     case DOTSTAR_EXPR:
     case MEMBER_REF:
+    case PREDECREMENT_EXPR:
+    case PREINCREMENT_EXPR:
+    case POSTDECREMENT_EXPR:
+    case POSTINCREMENT_EXPR:
       return build_nt
        (code, tsubst_copy (TREE_OPERAND (t, 0), args, complain, in_decl),
         tsubst_copy (TREE_OPERAND (t, 1), args, complain, in_decl));