From 6acc8d53a91f4c3630fc85274ea75e8224fcdf37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabien=20Ch=C3=AAne?= <fabien@gcc.gnu.org> Date: Fri, 17 Feb 2012 08:49:35 +0100 Subject: [PATCH] re PR c++/52126 (compilation error) gcc/testsuite/ChangeLog 2012-02-16 Fabien Chene <fabien@gcc.gnu.org> PR c++/52126 * g++.dg/template/using21.C: New. * g++.dg/template/using22.C: Likewise. gcc/cp/ChangeLog 2012-02-16 Fabien Chene <fabien@gcc.gnu.org> PR c++/52126 * decl.c (xref_basetypes): call dependent_scope_p instead of dependent_type_p. From-SVN: r184328 --- gcc/cp/ChangeLog | 6 +++++ gcc/cp/decl.c | 2 +- gcc/testsuite/ChangeLog | 6 +++++ gcc/testsuite/g++.dg/template/using21.C | 28 +++++++++++++++++++++ gcc/testsuite/g++.dg/template/using22.C | 33 +++++++++++++++++++++++++ 5 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/g++.dg/template/using21.C create mode 100644 gcc/testsuite/g++.dg/template/using22.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 773f36452497..c6bf817c5fd1 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2012-02-16 Fabien Chêne <fabien@gcc.gnu.org> + + PR c++/52126 + * decl.c (xref_basetypes): call dependent_scope_p instead of + dependent_type_p. + 2012-02-16 Jason Merrill <jason@redhat.com> PR c++/51415 diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index f0ba1816384d..90746a5c9fed 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -11880,7 +11880,7 @@ xref_basetypes (tree ref, tree base_list) TYPE_FOR_JAVA (ref) = 1; base_binfo = NULL_TREE; - if (CLASS_TYPE_P (basetype) && !dependent_type_p (basetype)) + if (CLASS_TYPE_P (basetype) && !dependent_scope_p (basetype)) { base_binfo = TYPE_BINFO (basetype); /* The original basetype could have been a typedef'd type. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4ae411963b7f..72f9f745d744 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2012-02-16 Fabien Chêne <fabien@gcc.gnu.org> + + PR c++/52126 + * g++.dg/template/using21.C: New. + * g++.dg/template/using22.C: Likewise. + 2012-02-16 Jason Merrill <jason@redhat.com> PR c++/51415 diff --git a/gcc/testsuite/g++.dg/template/using21.C b/gcc/testsuite/g++.dg/template/using21.C new file mode 100644 index 000000000000..7f61f8547499 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/using21.C @@ -0,0 +1,28 @@ +// PR c++/52126 +// { dg-do compile } + +template<typename T> +struct A +{ + int foo; + + struct B : A<T> + { + using A::foo; + }; + + struct C : A + { + using A::foo; + }; + + struct D : A<T> + { + using A<T>::foo; + }; + + struct E : A + { + using A<T>::foo; + }; +}; diff --git a/gcc/testsuite/g++.dg/template/using22.C b/gcc/testsuite/g++.dg/template/using22.C new file mode 100644 index 000000000000..b456e62e8950 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/using22.C @@ -0,0 +1,33 @@ +// PR c++/52126 +// { dg-do compile } + +template <class T> struct Z {}; + +template<typename T> +struct A +{ + struct B : A<T> + { + using A::nonexist; // { dg-error "no members matching" } + }; + + struct C : A + { + using A::nonexist; // { dg-error "no members matching" } + }; + + struct D : A<T> + { + using A<T>::nonexist; // { dg-error "no members matching" } + }; + + struct E : A + { + using A<T>::nonexist; // { dg-error "no members matching" } + }; + + struct F : Z<T> + { + using Z<T>::nonexist; + }; +}; -- GitLab