A using-directive is
active in a scope S at a program point P
if it precedes P and inhabits either S or
the scope of a namespace nominated by a using-directive
that is active in S at P.
for any scope U that contains P and is or is contained by S,
each namespace contained by S that is nominated by
a using-directive that is active in U at P.
If no declarations are found,
the results of the unqualified search are
the results of an unqualified search in the parent scope of S, if any,
from P.
If that lookup finds nothing, it undergoes unqualified name lookup;
in each case, only names
that denote types or templates whose specializations are types are considered.
If that lookup finds nothing, it undergoes unqualified name lookup.
[Example 1: using I =int;
using D =double;
namespace A {inlinenamespace N {using C =char; }using F =float;
void f(I);
void f(D);
void f(C);
void f(F);
}struct X0 {using F =float; };
struct W {using D =void;
struct X : X0 {void g(I);
void g(::D);
void g(F);
};
};
namespace B {typedefshort I, F;
class Y {friendvoid A::f(I); // error: no void A::f(short)friendvoid A::f(D); // OKfriendvoid A::f(C); // error: A::N::C not foundfriendvoid A::f(F); // OKfriendvoid W::X::g(I); // error: no void X::g(short)friendvoid W::X::g(D); // OKfriendvoid W::X::g(F); // OK};
} — end example]