diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 773f364524973e720251479d47ed74b887fe3685..c6bf817c5fd1b1bfd7831b9ba33e9fdf211422ba 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 f0ba1816384db7a889fb2025a45c0398c3049868..90746a5c9fed17ed513a492c35bcfeec5fb0c2f1 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 4ae411963b7fa582fe08467b13c7d206fe200e41..72f9f745d744d5c0dae90f15ce618d828870a95a 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 0000000000000000000000000000000000000000..7f61f85474997bfbcaf9fde3f9f8017242124510 --- /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 0000000000000000000000000000000000000000..b456e62e8950eb309caafd245d691799309b711c --- /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; + }; +};