[cfe-dev] Extern ref from method defined outside its namespace
Robinson, Paul
Paul.Robinson at am.sony.com
Thu Dec 20 12:05:27 PST 2012
> Within an out-of-line declaration, the enclosing namespace is the
> original namespace of the entity, not the lexical namespace.
>
> C++11 [namespace.def]p6:
> The enclosing namespaces of a declaration are those namespaces in
> which the declaration lexically appears, except for a redeclaration of a
> namespace member outside its original namespace (e.g., a definition
> as specified in 7.3.1.2). Such a redeclaration has the same enclosing
> namespaces as the original declaration.
>
> John.
Okay, so the method definition actually does implicitly reopen the
namespace scope. Thanks for pointing out where that's specified!
--paulr
More information about the cfe-dev
mailing list