Linkage of enumerators
6.6 [basic.link]
Richard Smith

Created on 2015-11-12.00:00:00 last changed 36 months ago


Date: 2017-03-15.00:00:00

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

    • ...

    • an enumerator belonging to an enumeration with linkage; or

    • ...

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

  4. Two names that are the same (Clause Clause 6 [basic]) and that are declared in different scopes shall denote the same variable, function, type, enumerator, template or namespace if...
Date: 2017-02-15.00:00:00

[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?

Date User Action Args
2018-02-27 00:00:00adminsetstatus: tentatively ready -> c++17
2017-02-06 00:00:00adminsetmessages: + msg5724
2015-11-12 00:00:00admincreate