This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 114a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2024-04-18


2444. Constant expressions in initialization odr-use

Section: 6.9.3.3  [basic.start.dynamic]     Status: drafting     Submitter: Davis Herring     Date: 2019-11-06

According to 6.9.3.3 [basic.start.dynamic] paragraph 3,

A non-initialization odr-use is an odr-use (6.3 [basic.def.odr]) not caused directly or indirectly by the initialization of a non-local static or thread storage duration variable.

Paragraphs 4-6 uses this term to exclude such odr-uses from consideration in determining the point by which a deferred initialization must be performed. A static_assert or a template argument expression can odr-use a variable, but it cannot be said to define any time during execution.

Suggestion: Add constant expression evaluation to the definition. Rename the term to “initializing odr-use” (based on effect rather than cause). Add a note saying that no such odr-use can occur before main begins.

Notes from the February, 2021 teleconference:

CWG agreed with the direction.