]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
pt.c (add_to_template_args): Fix thinko.
authorJason Merrill <jason@yorick.cygnus.com>
Fri, 27 Feb 1998 17:46:01 +0000 (17:46 +0000)
committerJason Merrill <jason@gcc.gnu.org>
Fri, 27 Feb 1998 17:46:01 +0000 (12:46 -0500)
* pt.c (add_to_template_args): Fix thinko.
(instantiate_class_template): Call it later.

From-SVN: r18286

gcc/cp/ChangeLog
gcc/cp/pt.c

index 136a71ae3779f27f386784eb86950b9ec9370d95..90b77ceb04012263142dd53d878bec0e07305cd3 100644 (file)
@@ -1,5 +1,8 @@
 Fri Feb 27 11:17:50 1998  Jason Merrill  <jason@yorick.cygnus.com>
 
+       * pt.c (add_to_template_args): Fix thinko.
+       (instantiate_class_template): Call it later.
+
        * pt.c (get_class_bindings): Add outer_args parm.
        (most_specialized_class): Likewise.
        (instantiate_class_template): Pass it.
index d5362aae34bf5e2ae8652b72c447727926ae6cb7..10d7f97bb030be0b3dbc967f9e330f0b459dbbeb 100644 (file)
@@ -308,7 +308,7 @@ add_to_template_args (args, extra_args)
     {
       int i;
 
-      new_args = make_tree_vec (TREE_VEC_LENGTH (args) - 1);
+      new_args = make_tree_vec (TREE_VEC_LENGTH (args) + 1);
 
       for (i = 0; i < TREE_VEC_LENGTH (args); ++i)
        TREE_VEC_ELT (new_args, i) = TREE_VEC_ELT (args, i);
@@ -2480,6 +2480,7 @@ lookup_template_class (d1, arglist, in_decl, context)
            }
        }
 
+      /* FIXME avoid duplication.  */
       mangled_name = mangle_class_name_for_template (IDENTIFIER_POINTER (d1),
                                                     parmlist,
                                                     arglist,
@@ -2996,9 +2997,6 @@ instantiate_class_template (type)
     args = get_class_bindings (TREE_VALUE (t), TREE_PURPOSE (t),
                               args, outer_args);
 
-  if (outer_args)
-    args = add_to_template_args (outer_args, args);
-
   if (pedantic && uses_template_parms (args))
     /* If there are still template parameters amongst the args, then
        we can't instantiate the type; there's no telling whether or not one
@@ -3014,6 +3012,9 @@ instantiate_class_template (type)
   maybe_push_to_top_level (uses_template_parms (type));
   pushclass (type, 0);
 
+  if (outer_args)
+    args = add_to_template_args (outer_args, args);
+
   if (flag_external_templates)
     {
       if (flag_alt_external_templates)