Commit 2395cd2e by Jason Merrill Committed by Jason Merrill

re PR c++/34870 (argument-dependent lookup fails to find friend declaration)

	PR c++/34870
	* name-lookup.c (arg_assoc_class): Call complete_type.
	* pt.c (instantiate_class_template): Call uses_template_parms
	instead of dependent_type_p.

From-SVN: r153958
parent 9d79aec3
2009-11-05 Jason Merrill <jason@redhat.com> 2009-11-05 Jason Merrill <jason@redhat.com>
PR c++/34870
* name-lookup.c (arg_assoc_class): Call complete_type.
* pt.c (instantiate_class_template): Call uses_template_parms
instead of dependent_type_p.
PR c++/41703 PR c++/41703
* pt.c (check_undeduced_parms): New subroutine of... * pt.c (check_undeduced_parms): New subroutine of...
(more_specialized_fn): ...here. Undeduced template parms can make (more_specialized_fn): ...here. Undeduced template parms can make
......
...@@ -4780,6 +4780,8 @@ arg_assoc_class (struct arg_lookup *k, tree type) ...@@ -4780,6 +4780,8 @@ arg_assoc_class (struct arg_lookup *k, tree type)
if (arg_assoc_namespace (k, context)) if (arg_assoc_namespace (k, context))
return true; return true;
complete_type (type);
if (TYPE_BINFO (type)) if (TYPE_BINFO (type))
{ {
/* Process baseclasses. */ /* Process baseclasses. */
......
...@@ -7358,7 +7358,7 @@ instantiate_class_template (tree type) ...@@ -7358,7 +7358,7 @@ instantiate_class_template (tree type)
if (TYPE_BEING_DEFINED (type) if (TYPE_BEING_DEFINED (type)
|| COMPLETE_TYPE_P (type) || COMPLETE_TYPE_P (type)
|| dependent_type_p (type)) || uses_template_parms (type))
return type; return type;
/* Figure out which template is being instantiated. */ /* Figure out which template is being instantiated. */
......
2009-11-05 Jason Merrill <jason@redhat.com> 2009-11-05 Jason Merrill <jason@redhat.com>
PR c++/34870
* g++.dg/lookup/koenig7.C: New.
PR c++/41703 PR c++/41703
* g++.dg/template/partial6.C: New. * g++.dg/template/partial6.C: New.
......
// PR c++/34870
template <typename T>
struct Foo
{
friend void func(const Foo &) {}
};
void check(const Foo<int> & x)
{
func(x);
}
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