GCC does not accept this code, but is supposed to. "foo" is looked up using unqualified name lookup, during which dependent base classes are ignored. The fact that "foo" is dependent must not influence this.
template<typename T> struct HasFoo { void foo() { } }; // dependent "HasFoo<T>" should be ignored during // lookup of "foo" template<typename T> struct Bar : HasFoo<T> { void bar() { foo(T()); } }; namespace A { struct Baz { }; void foo(Baz); // should be found! } int main() { Bar<A::Baz> b; b.bar(); } -- Summary: GCC looks into dependent bases during unqualified lookup Product: gcc Version: 4.4.3 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: schaub-johannes at web dot de GCC host triplet: i686-pc-linux-gnu GCC target triplet: i686-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43282