Friend declarations refer to functions or classes that are
members of the nearest enclosing namespace, but they do not introduce
new names into that namespace ([namespace.memdef]).

Function
declarations at block scope and variable declarations with the
extern specifier at block scope refer to declarations that are
members of an enclosing namespace, but they do not introduce new names
into that scope.