Created on 1999-06-25.00:00:00 last changed 292 months ago
Proposed resolution: Change the text in 6.6 [basic.link] paragraph 8 from:
A name with no linkage (notably, the name of a class or enumeration declared in a local scope (6.4.3 [basic.scope.block])) shall not be used to declare an entity with linkage.to:
A name with no linkage (notably, the name of a class or enumeration declared in a local scope (6.4.3 [basic.scope.block])) or an unnamed type shall not be used to declare an entity with linkage.In section 6.6 [basic.link] paragraph 8, add to the example, before the closing brace of function f:
extern struct {} x; // ill-formed
Rationale (10/00): The proposed change would have introduced an incompatibility with the C language. For example, the global declaration
static enum { A, B, C } abc;
represents an idiom that is used in C but would be prohibited under this resolution.
6.6 [basic.link] paragraph 8 says,
A name with no linkage (notably, the name of a class or enumeration declared in a local scope (6.4.3 [basic.scope.block] )) shall not be used to declare an entity with linkage.This wording does not, but should, prohibit use of an unnamed local type in the declaration of an entity with linkage. For example,
void f() { extern struct { } x; // currently allowed }
Proposed resolution: Change the text in 6.6 [basic.link] paragraph 8 from:
A name with no linkage (notably, the name of a class or enumeration declared in a local scope (6.4.3 [basic.scope.block])) shall not be used to declare an entity with linkage.to:
A name with no linkage (notably, the name of a class or enumeration declared in a local scope (6.4.3 [basic.scope.block])) or an unnamed type shall not be used to declare an entity with linkage.In section 6.6 [basic.link] paragraph 8, add to the example, before the closing brace of function f:
extern struct {} x; // ill-formed
Rationale (10/00): The proposed change would have introduced an incompatibility with the C language. For example, the global declaration
static enum { A, B, C } abc;
represents an idiom that is used in C but would be prohibited under this resolution.
History | |||
---|---|---|---|
Date | User | Action | Args |
2000-11-18 00:00:00 | admin | set | messages: + msg458 |
2000-11-18 00:00:00 | admin | set | status: ready -> nad |
2000-05-21 00:00:00 | admin | set | status: drafting -> ready |
2000-02-23 00:00:00 | admin | set | status: open -> drafting |
1999-06-25 00:00:00 | admin | create |