Created on 2012-03-09.00:00:00 last changed 131 months ago
[Moved to DR at the April, 2013 meeting.]
Proposed resolution (October, 2012):
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 or function95 the friend class or function is a member of the innermost enclosing namespace.The name of the friend is not found byThe friend declaration does not by itself make the name visible to unqualified lookup (6.5.3 [basic.lookup.unqual]) orbyqualified lookup (6.5.5 [basic.lookup.qual]). [Note: The name of the friend will be visible in its namespace ifuntila matching declaration is providedin thatat namespace scope (either before or after the class definition granting friendship). —end note] If a friend function is called...
According to _N4868_.9.8.2.3 [namespace.memdef] paragraph 3,
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 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).
Taken literally, that would mean the following example is ill-formed:
namespace N { struct A { friend int f(); }; } int N::f() { return 0; } int i = N::f(); // ill-formed: N::f not found
because the definition of N::f appears in global scope rather than in namespace scope.
History | |||
---|---|---|---|
Date | User | Action | Args |
2014-03-03 00:00:00 | admin | set | status: drwp -> cd3 |
2013-10-14 00:00:00 | admin | set | status: dr -> drwp |
2013-05-03 00:00:00 | admin | set | messages: + msg4403 |
2013-05-03 00:00:00 | admin | set | status: tentatively ready -> dr |
2012-11-03 00:00:00 | admin | set | messages: + msg4073 |
2012-11-03 00:00:00 | admin | set | status: open -> tentatively ready |
2012-03-09 00:00:00 | admin | create |