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

2024-10-26


1294. Side effects in dynamic/static initialization

Section: 6.9.3.2  [basic.start.static]     Status: open     Submitter: Daniel Krügler     Date: 2011-04-08

According to 6.9.3.2 [basic.start.static] paragraph 3,

An implementation is permitted to perform the initialization of a non-local variable with static storage duration as a static initialization even if such initialization is not required to be done statically, provided that

This does not consider side effects of the initialization in this determination, only the values of namespace-scope variables.

CWG 2022-11-11

The precise normative identification of side effects relevant for the rule remains open. An approach similar to the constexpr model of considering the transitive hull of evaluations might be applicable.