Let us define f, as a friend function of S, inside the declaration of S:
struct S
{
friend void f() {}
};
<
The name f is declared in a friend declaration, even it becomes the member of the namespace which contains S, but it's not visible for name lookup, unless it's redeclared at namespace scope. If not, it could be found only by ADL.
Names introduced by friend declarations within a non-local class
Xbecome members of the innermost enclosing namespace ofX, but they do not become visible to ordinary name lookup (neither unqualified nor qualified) unless a matching declaration is provided at namespace scope, either before or after the class definition. Such name may be found through ADL which considers both namespaces and classes.