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
[Voted into the WP at the November, 2010 meeting.]
N3092 comment DE 4It 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 hasexternal linkagethe same linkage as the enclosing namespace if it is the name of
a variable
, unless it has internal linkage; ora function
, unless it has internal linkage; ora named class (Clause 11 [class]), or an unnamed class defined in a typedef declaration in which the class has the typedef name for linkage purposes (9.2.4 [dcl.typedef]); or
a named enumeration (9.7.1 [dcl.enum]), or an unnamed enumeration defined in a typedef declaration in which the enumeration has the typedef name for linkage purposes (9.2.4 [dcl.typedef]); or
an enumerator belonging to an enumeration with
externallinkage; ora template
, unless it is a function template that has internal linkage (Clause 13 [temp]); or.
a namespace (9.8 [basic.namespace]), unless it is declared within an unnamed namespace.