Created on 2021-07-02.00:00:00 last changed 5 months ago
Proposed resolution, December, 2021:
Change 6.3 [basic.def.odr] paragraph 1 as follows:
No translation unit shall contain more than one definition of any
variable, function, class type, enumeration type, template, default argument for a parameter (for a function in a given scope), or default template argument.
Change 6.3 [basic.def.odr] paragraph 10 as follows:
Every program shall contain
exactlyone definition of every non-inlinefunction or variable that is odr-used in that program outside of a discarded statement (8.5.2 [stmt.if]); no diagnostic required. The definition...
Change 6.3 [basic.def.odr] paragraph 13 as follows:
There can be more than one definition of a
class type (Clause 11 [class]),
enumeration type (9.7.1 [dcl.enum]),
inline function or variable (9.2.8 [dcl.inline]),
templated entity (13.1 [temp.pre]),
default argument for a parameter (for a function in a given scope) (188.8.131.52 [dcl.fct.default]), or
default template argument (13.2 [temp.param])
in a program provided that each definition appears in a different translation unit and the definitions satisfy the following requirements.
Given such an
entity D defined in more than one translation unit, for all definitions of D, or, if D is an unnamed enumeration, for all definitions of D that are reachable at any given program point, the following requirements shall be satisfied...
Delete 6.3 [basic.def.odr] paragraph 15:
If these definitions do not satisfy these requirements, then the program is ill-formed; a diagnostic is required only if the entity is attached to a named module and a prior definition is reachable at the point where a later definition occurs.
Notes from the August, 2021 teleconference:
CWG observed that there is a similar problem in paragraph 13. See also issue 1849.
[Accepted at the February, 2022 meeting.]
According to 6.3 [basic.def.odr] paragraph 10,
Every program shall contain exactly one definition of every non-inline function or variable that is odr-used in that program outside of a discarded statement (8.5.2 [stmt.if]); no diagnostic required.
This wording could be interpreted as allowing multiple definitions of non-inline variables and functions if they are not odr-used. That is presumably not the intent.
|2022-02-15 00:00:00||admin||set||status: ready -> dr|
|2022-01-06 00:00:00||admin||set||messages: + msg6595|
|2022-01-06 00:00:00||admin||set||status: drafting -> ready|
|2021-11-15 00:00:00||admin||set||messages: + msg6535|