diff options
-rw-r--r-- | gcc/cp/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/cp/pt.c | 9 |
2 files changed, 8 insertions, 4 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 136a71a..90b77ce 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index d5362aa..10d7f97 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -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) |