diff options
author | Jason Merrill <jason@redhat.com> | 2009-11-05 22:33:06 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2009-11-05 22:33:06 -0500 |
commit | 2395cd2e91cda97a8d0bad70134f12534d4d3562 (patch) | |
tree | 36c863cb57d29cf3f39f10511e26315ffeb25b90 | |
parent | 9d79aec3134c59555a81daef276e5cde380688e6 (diff) | |
download | gcc-2395cd2e91cda97a8d0bad70134f12534d4d3562.zip gcc-2395cd2e91cda97a8d0bad70134f12534d4d3562.tar.gz gcc-2395cd2e91cda97a8d0bad70134f12534d4d3562.tar.bz2 |
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
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/name-lookup.c | 2 | ||||
-rw-r--r-- | gcc/cp/pt.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/lookup/koenig7.C | 12 |
5 files changed, 23 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index a2d44dc..0dfc57f 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,10 @@ 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 * pt.c (check_undeduced_parms): New subroutine of... (more_specialized_fn): ...here. Undeduced template parms can make diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index c3f742e..14f9787 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -4780,6 +4780,8 @@ arg_assoc_class (struct arg_lookup *k, tree type) if (arg_assoc_namespace (k, context)) return true; + complete_type (type); + if (TYPE_BINFO (type)) { /* Process baseclasses. */ diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 74273eb..d4556cd 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -7358,7 +7358,7 @@ instantiate_class_template (tree type) if (TYPE_BEING_DEFINED (type) || COMPLETE_TYPE_P (type) - || dependent_type_p (type)) + || uses_template_parms (type)) return type; /* Figure out which template is being instantiated. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 6454237..eedfe22 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2009-11-05 Jason Merrill <jason@redhat.com> + PR c++/34870 + * g++.dg/lookup/koenig7.C: New. + PR c++/41703 * g++.dg/template/partial6.C: New. diff --git a/gcc/testsuite/g++.dg/lookup/koenig7.C b/gcc/testsuite/g++.dg/lookup/koenig7.C new file mode 100644 index 0000000..bc54ba9 --- /dev/null +++ b/gcc/testsuite/g++.dg/lookup/koenig7.C @@ -0,0 +1,12 @@ +// PR c++/34870 + +template <typename T> +struct Foo +{ + friend void func(const Foo &) {} +}; + +void check(const Foo<int> & x) +{ + func(x); +} |