c++: Call tsubst_pack_expansion from tsubst.
authorJason Merrill <jason@redhat.com>
Fri, 6 Nov 2020 20:51:10 +0000 (15:51 -0500)
committerJason Merrill <jason@redhat.com>
Mon, 9 Nov 2020 20:16:39 +0000 (15:16 -0500)
This was unnecessary (and incomplete) code duplication.

gcc/cp/ChangeLog:

* pt.c (tsubst): Replace *_ARGUMENT_PACK code with
a call to tsubst_argument_pack.

gcc/cp/pt.c

index 2a885a9..88644b9 100644 (file)
@@ -16060,20 +16060,7 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl)
 
     case TYPE_ARGUMENT_PACK:
     case NONTYPE_ARGUMENT_PACK:
-      {
-        tree r;
-
-       if (code == NONTYPE_ARGUMENT_PACK)
-         r = make_node (code);
-       else
-         r = cxx_make_type (code);
-
-       tree pack_args = ARGUMENT_PACK_ARGS (t);
-       pack_args = tsubst_template_args (pack_args, args, complain, in_decl);
-       SET_ARGUMENT_PACK_ARGS (r, pack_args);
-
-       return r;
-      }
+      return tsubst_argument_pack (t, args, complain, in_decl);
 
     case VOID_CST:
     case INTEGER_CST: