Created on 2000-03-13.00:00:00 last changed 33 months ago
[Moved to DR at 10/01 meeting.]
Proposed resolution:
Change text in 6.6 [basic.link] paragraph 5 from:
In addition, a member function, static data member, class or enumeration of class scope has external linkage if the name of the class has external linkage.to:
In addition, a member function, a static data member, a named class or enumeration of class scope, or an unnamed class or enumeration defined in a class-scope typedef declaration such that the class or enumeration has the typedef name for linkage purposes (9.2.4 [dcl.typedef]), has external linkage if the name of the class has external linkage.
A name having namespace scope has external linkage if it is the name ofThat prohibits for example:
- [...]
- 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])
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.6 [basic.link] paragraph 5 says:
In addition, a member function, static data member, class or enumeration of class scope has external linkage if the name of the class has external linkage.
That allows for:
struct S { typedef enum { e1 } *MPE; void mf(MPE) {} };
My guess is that this is an unintentional consequence of 6.6 [basic.link] paragraph 5, but I would like confirmation on that.
History | |||
---|---|---|---|
Date | User | Action | Args |
2022-02-18 07:47:23 | admin | set | messages: + msg6653 |
2008-10-05 00:00:00 | admin | set | status: wp -> cd1 |
2003-04-25 00:00:00 | admin | set | status: dr -> wp |
2002-05-10 00:00:00 | admin | set | messages: + msg662 |
2001-11-09 00:00:00 | admin | set | status: ready -> dr |
2001-05-20 00:00:00 | admin | set | status: review -> ready |
2000-09-16 00:00:00 | admin | set | status: drafting -> review |
2000-03-13 00:00:00 | admin | create |