This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 112e. See for the official list.


1659. Initialization order of thread_local template static data members

Section:  [basic.start.static]     Status: open     Submitter: Richard Smith     Date: 2013-04-14

According to [basic.start.static] paragraph 5,

It is implementation-defined whether the dynamic initialization of a non-local variable with static or thread storage duration is done before the first statement of the initial function of the thread. If the initialization is deferred to some point in time after the first statement of the initial function of the thread, it shall occur before the first odr-use (6.3 [basic.def.odr]) of any variable with thread storage duration defined in the same translation unit as the variable to be initialized.

This doesn't consider that initialization of instantiations of static data members of class templates (which can be thread_local) are unordered. Presumably odr-use of such a static data member should not trigger the initialization of any thread_local variable other than that one?