Created on 2006-03-08.00:00:00 last changed 178 months ago
[Voted into the WP at the March, 2009 meeting.]
Proposed resolution (June, 2008):
Change 9.11 [dcl.link] paragraph 5 as follows:
If two declarationsof the same function or objectdeclare functions with the same name and parameter-type-list (9.3.4.6 [dcl.fct]) to be members of the same namespace or declare objects with the same name to be members of the same namespacespecify different linkage-specifications (that is, the linkage-specifications of these declarations specify different string-literals)and the declarations give the names different language linkages, the program is ill-formedif the declarations appear in the same translation unit, and the one definition rule (6.3 [basic.def.odr]) applies; no diagnostic is required if the declarations appear in different translation units.
The wording of 9.11 [dcl.link] paragraph 5 is suspect:
If two declarations of the same function or object specify different linkage-specifications (that is, the linkage-specifications of these declarations specify different string-literals), the program is ill-formed if the declarations appear in the same translation unit, and the one definition rule (3.2) applies if the declarations appear in different translation units.
But what if only one of the declarations has a linkage-specification, while the other is left with the default C++ linkage? Shouldn't this restriction be phrased in terms of the functions’ or objects’ language linkage rather than linkage-specifications?
(Additional note [wmm]: Is the ODR the proper vehicle for enforcing this requirement? This is dealing with declarations, not necessarily definitions. Shouldn't this say “ill-formed, no diagnostic required” instead of some vague reference to the ODR?)
History | |||
---|---|---|---|
Date | User | Action | Args |
2010-03-29 00:00:00 | admin | set | status: wp -> cd2 |
2009-08-03 00:00:00 | admin | set | status: dr -> wp |
2009-03-23 00:00:00 | admin | set | messages: + msg2025 |
2009-03-23 00:00:00 | admin | set | status: ready -> dr |
2008-10-05 00:00:00 | admin | set | status: review -> ready |
2008-06-29 00:00:00 | admin | set | messages: + msg1699 |
2008-06-29 00:00:00 | admin | set | status: drafting -> review |
2006-11-05 00:00:00 | admin | set | status: open -> drafting |
2006-03-08 00:00:00 | admin | create |