http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51641
Bug #: 51641
Summary: Lookup finds enclosing class member instead of
template parameter
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Keywords: accepts-invalid
Severity: normal
Priority: P3
Component: c++
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
Depends on: 36019, 45625
Another case of the lookup problem you fixed previously has come up on the core
mailing list:
struct A {
struct B { typedef int X; };
};
template<class B> struct C : A {
B::X q; // Ok: A::B.
struct U { typedef int X; };
template<class U>
struct D;
};
template<class B>
template<class U>
struct C<B>::D {
typename U::X r; // { dg-error "" }
C<int>::D<double> y;
The use of U in D should find the template parameter, leading to an error on
instantiation.