Title
Constant expressions in initialization odr-use
Status
drafting
Section
6.9.3.3 [basic.start.dynamic]
Submitter
Davis Herring

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

Messages

Date: 2021-02-15.00:00:00

Notes from the February, 2021 teleconference:

CWG agreed with the direction.

Date: 2022-09-25.18:08:42

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.

History
Date User Action Args
2021-02-17 00:00:00adminsetmessages: + msg6486
2021-02-17 00:00:00adminsetstatus: open -> drafting
2019-11-06 00:00:00admincreate