This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 119a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2025-12-20
[Moved to DR at 10/01 meeting.]
6.7 [basic.link] paragraph 4 says (among other things):A name having namespace scope has external linkage if it is the name ofThat prohibits for example:
- [...]
- a named enumeration (9.8.1 [dcl.enum]), or anunnamed enumeration definedin a typedef declaration in which the enumeration has the typedefname for linkage purposes (9.2.4 [dcl.typedef])
typedef enum { e1 } *PE; void f(PE) {} // Cannot declare a function (with linkage) using a // type with no linkage.However, the same prohibition was not made for class scope types. Indeed,6.7 [basic.link] paragraph 5 says:
In addition, a member function, static data member, class orenumeration of class scope has external linkage if the name of theclass has external linkage.
That allows for:
struct S { typedef enum { e1 } *MPE; void mf(MPE) {} };My guess is that this is an unintentional consequence of6.7 [basic.link] paragraph 5, but I would like confirmationon that.
Proposed resolution:
Change text in 6.7 [basic.link] paragraph 5 from:
In addition, a member function, static data member, class orenumeration of class scope has external linkage if the name of theclass has external linkage.to:
In addition, a member function, a static data member, a named class orenumeration of class scope, or an unnamed class or enumeration definedin a class-scope typedef declaration such that the class orenumeration has the typedef name for linkage purposes(9.2.4 [dcl.typedef]),has external linkage if the name of the class has external linkage.