Commit fdfacfa1 by Jason Merrill Committed by Jason Merrill

pt.c (lookup_template_class): Use currently_open_class, compare template args later.

	* pt.c (lookup_template_class): Use currently_open_class,
	compare template args later.

From-SVN: r148915
parent e450b4f3
2009-06-24 Jason Merrill <jason@redhat.com> 2009-06-24 Jason Merrill <jason@redhat.com>
* pt.c (lookup_template_class): Use currently_open_class,
compare template args later.
PR c++/40342 PR c++/40342
* decl.c (decls_match): Check DECL_TI_TEMPLATE too. * decl.c (decls_match): Check DECL_TI_TEMPLATE too.
* class.c (resolve_address_of_overloaded_function): Fix typo. * class.c (resolve_address_of_overloaded_function): Fix typo.
......
...@@ -5845,31 +5845,13 @@ lookup_template_class (tree d1, ...@@ -5845,31 +5845,13 @@ lookup_template_class (tree d1,
the `C<T>' is just the same as `C'. Outside of the the `C<T>' is just the same as `C'. Outside of the
class, however, such a reference is an instantiation. */ class, however, such a reference is an instantiation. */
if (comp_template_args (TYPE_TI_ARGS (template_type), if ((entering_scope
arglist)) || !PRIMARY_TEMPLATE_P (templ)
{ || currently_open_class (template_type))
found = template_type; /* comp_template_args is expensive, check it last. */
&& comp_template_args (TYPE_TI_ARGS (template_type),
if (!entering_scope && PRIMARY_TEMPLATE_P (templ)) arglist))
{ POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, template_type);
tree ctx;
for (ctx = current_class_type;
ctx && TREE_CODE (ctx) != NAMESPACE_DECL;
ctx = (TYPE_P (ctx)
? TYPE_CONTEXT (ctx)
: DECL_CONTEXT (ctx)))
if (TYPE_P (ctx) && same_type_p (ctx, template_type))
goto found_ctx;
/* We're not in the scope of the class, so the
TEMPLATE_TYPE is not the type we want after all. */
found = NULL_TREE;
found_ctx:;
}
}
if (found)
POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, found);
/* If we already have this specialization, return it. */ /* If we already have this specialization, return it. */
found = retrieve_specialization (templ, arglist, found = retrieve_specialization (templ, arglist,
......
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