This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 110d. See for the official list.


165. Definitions of friends and block-scope externs

Section: _N4868_.  [namespace.memdef]     Status: NAD     Submitter: Derek Inglis     Date: 7 Sep 1999

_N4868_. [namespace.memdef] paragraph 2 says,

Members of a named namespace can also be defined outside that namespace by explicit qualification ( [namespace.qual] ) of the name being defined, provided that the entity being defined was already declared in the namespace...
It is not clear whether block-scope extern declarations and friend declarations are sufficient to permit the named entities to be defined outside their namespace. For example,
    namespace NS {
       struct A { friend struct B; };
       void foo() { extern void bar(); }
    struct NS::B { };   // 1) legal?
    void NS::bar() { }  // 2) legal?

Rationale (10/99): Entities whose names are "invisibly injected" into a namespace as a result of friend declarations are not "declared" in that namespace until an explicit declaration of the entity appears at namespace scope. Consequently, the definitions in the example are ill-formed.

(See also issues 95, 136, 138, 139, 143, and 166.)