This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 115d. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2024-10-26


1113. Linkage of namespace member of unnamed namespace

Section: 6.6  [basic.link]     Status: C++11     Submitter: DE     Date: 2010-08-02

[Voted into the WP at the November, 2010 meeting.]

N3092 comment DE 4

It is odd that, in the following example, N has no linkage but g has external linkage:

    namespace {
      namespace N // has no linkage
      {
        void g(); // has external linkage
      }
    }

Proposed resolution (August, 2010):

Change 6.6 [basic.link] paragraph 4 as follows:

An unnamed namespace or a namespace declared directly or indirectly within an unnamed namespace has internal linkage. All other namespaces have external linkage. A name having namespace scope that has not been given internal linkage above has external linkage the same linkage as the enclosing namespace if it is the name of