// PR c++/94799 - member template function lookup fails. template struct A { int a() { return 42; } template struct X { typedef int type; }; }; template struct B { int b(A *p) { int i = 0; i += p->a(); i += p->template A::a(); i += p->template A::template A::a(); i += A().template A::a(); return i; } }; int main() { A a; B b; return b.b(&a); }