Constant expressions in initialization odr-use
Section [basic.start.dynamic]
Davis Herring

Created on 2019-11-06.00:00:00 last changed 14 months ago


Date: 2019-11-06.00:00:00

According to [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.

Date User Action Args
2019-11-06 00:00:00admincreate