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

2024-12-19


2198. Linkage of enumerators

Section: 6.6  [basic.link]     Status: C++17     Submitter: Richard Smith     Date: 2015-11-12

[Adopted at the February/March, 2017 meeting.]

According to the rules in 6.6 [basic.link] paragraph 4, the enumerators of an enumeration type with linkage also have linkage. Having same-named enumerators in different translation units would seem to be innocuous. Is there a rationale for this rule?

Proposed resolution (March, 2017):

  1. Delete 6.6 [basic.link] bullet 4.5:

  2. 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 the same linkage as the enclosing namespace if it is the name of

  3. Change 6.6 [basic.link] paragraph 9 as follows:

  4. Two names that are the same (6.1 [basic.pre]) and that are declared in different scopes shall denote the same variable, function, type, enumerator, template or namespace if...