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
[Voted into the WP at the March, 2009 meeting.]
The wording of 9.12 [dcl.link] paragraph 5 is suspect:
If two declarations of the same function or object specify differentlinkage-specifications (that is,thelinkage-specifications of these declarations specifydifferentstring-literals), the program is ill-formed if thedeclarations appear in the same translation unit, and the onedefinition rule (3.2) applies if the declarations appear in differenttranslation units.
But what if only one of the declarations has alinkage-specification, while the other is left with thedefault C++ linkage? Shouldn't this restriction be phrased in termsof the functions’ or objects’ language linkage rather thanlinkage-specifications?
(Additional note [wmm]: Is the ODR the proper vehicle forenforcing this requirement? This is dealing with declarations, notnecessarily definitions. Shouldn't this say “ill-formed, nodiagnostic required” instead of some vague reference to the ODR?)
Proposed resolution (June, 2008):
Change 9.12 [dcl.link] paragraph 5 as follows:
If two declarationsof the same function or objectdeclarefunctions with the same name and parameter-type-list (9.3.4.6 [dcl.fct]) to be members of the same namespace or declare objectswith the same name to be members of the same namespacespecifydifferentlinkage-specifications (that is, thelinkage-specifications of these declarations specify differentstring-literals)and the declarations give the namesdifferent language linkages, the program is ill-formedif thedeclarations appear in the same translation unit, and the onedefinition rule (6.3 [basic.def.odr]) applies; nodiagnostic is required if the declarations appear in differenttranslation units.