This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 115e. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2024-11-11
[Moved to DR at the October, 2012 meeting.]
According to _N4868_.9.8.2.3 [namespace.memdef] paragraph 3,
If a friend declaration in a non-local class first declares a class or function95 the friend class or function is a member of the innermost enclosing namespace. The name of the friend is not found by unqualified lookup (6.5.3 [basic.lookup.unqual]) or by qualified lookup (6.5.5 [basic.lookup.qual]) until a matching declaration is provided in that namespace scope (either before or after the class definition granting friendship).
This wording does not, but probably should, apply to friend declarations of function templates and class templates as well.
Proposed resolution (February, 2012):
Change 6.5.4 [basic.lookup.argdep] paragraph 1 as follows:
...in those namespaces, namespace-scope friend function or function template declarations (11.3) not otherwise visible may be found...
Change _N4868_.9.8.2.3 [namespace.memdef] paragraph 3 as follows:
Every name first declared in a namespace is a member of that namespace. If a friend declaration in a non-local class first declares a class,orfunction, class template, or function template95 the friendclass or functionis a member of the innermost enclosing namespace. The name of the friend is not found by unqualified lookup (6.5.3 [basic.lookup.unqual]) or by qualified lookup (6.5.5 [basic.lookup.qual]) until a matching declaration is provided in that namespace scope (either before or after the class definition granting friendship). If a friend function or function template is called, its name may be found by the name lookup that considers functions from namespaces and classes associated with the types of the function arguments (6.5.4 [basic.lookup.argdep]). If the name in a friend declaration...