Unless otherwise specified,
a qualified name undergoes qualified name lookup in its lookup context
from the point where it appears
unless the lookup context either
is dependent and is not the current instantiation (
[temp.dep.type]) or
is not a class or class template
.[
Note 2: 
During lookup for a template specialization, no names are dependent
. — 
end note]
[
Example 3: 
int f();
struct A {
  int B, C;
  template<int> using D = void;
  using T = void;
  void f();
};
using B = A;
template<int> using C = A;
template<int> using D = A;
template<int> using X = A;
template<class T>
void g(T *p) {                  
  p->X<0>::f();                 
  p->template X<0>::f();        
  p->B::f();                    
  p->template C<0>::f();        
  p->template D<0>::f();        
  p->T::f();                    
}
template void g(A*);
 — 
end example]