Commit db897306 by Jason Merrill Committed by Jason Merrill

pt.c (add_to_template_args): Fix thinko.

	* pt.c (add_to_template_args): Fix thinko.
	(instantiate_class_template): Call it later.

From-SVN: r18286
parent 8d019cef
Fri Feb 27 11:17:50 1998 Jason Merrill <jason@yorick.cygnus.com> 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. * pt.c (get_class_bindings): Add outer_args parm.
(most_specialized_class): Likewise. (most_specialized_class): Likewise.
(instantiate_class_template): Pass it. (instantiate_class_template): Pass it.
......
...@@ -308,7 +308,7 @@ add_to_template_args (args, extra_args) ...@@ -308,7 +308,7 @@ add_to_template_args (args, extra_args)
{ {
int i; 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) for (i = 0; i < TREE_VEC_LENGTH (args); ++i)
TREE_VEC_ELT (new_args, i) = TREE_VEC_ELT (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) ...@@ -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), mangled_name = mangle_class_name_for_template (IDENTIFIER_POINTER (d1),
parmlist, parmlist,
arglist, arglist,
...@@ -2996,9 +2997,6 @@ instantiate_class_template (type) ...@@ -2996,9 +2997,6 @@ instantiate_class_template (type)
args = get_class_bindings (TREE_VALUE (t), TREE_PURPOSE (t), args = get_class_bindings (TREE_VALUE (t), TREE_PURPOSE (t),
args, outer_args); args, outer_args);
if (outer_args)
args = add_to_template_args (outer_args, args);
if (pedantic && uses_template_parms (args)) if (pedantic && uses_template_parms (args))
/* If there are still template parameters amongst the args, then /* If there are still template parameters amongst the args, then
we can't instantiate the type; there's no telling whether or not one we can't instantiate the type; there's no telling whether or not one
...@@ -3014,6 +3012,9 @@ instantiate_class_template (type) ...@@ -3014,6 +3012,9 @@ instantiate_class_template (type)
maybe_push_to_top_level (uses_template_parms (type)); maybe_push_to_top_level (uses_template_parms (type));
pushclass (type, 0); pushclass (type, 0);
if (outer_args)
args = add_to_template_args (outer_args, args);
if (flag_external_templates) if (flag_external_templates)
{ {
if (flag_alt_external_templates) if (flag_alt_external_templates)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment