Created on 2023-01-06.00:00:00 last changed yesterday
Proposed resolution (approved by CWG 2026-05-29):
Change in 6.10.3.3 [basic.start.dynamic] paragraph 7 as follows:
It is implementation-defined whether the dynamic initialization of a non-block non-inline variable with thread storage duration is sequenced before the first statement of the initial function of a thread or is deferred. If it is deferred, the initialization associated with the entity for thread t is sequenced before the first non-initialization odr-use by t of any non-inline variable with thread storage duration and dynamic initialization defined in the same translation unit as the variable to be initialized. ...
Subclause 6.10.3.3 [basic.start.dynamic] paragraph 7 specifies:
It is implementation-defined whether the dynamic initialization of a non-block non-inline variable with thread storage duration is sequenced before the first statement of the initial function of a thread or is deferred. If it is deferred, the initialization associated with the entity for thread t is sequenced before the first non-initialization odr-use by t of any non-inline variable with thread storage duration defined in the same translation unit as the variable to be initialized. ...
How does the rule quoted above affect variables declared constinit? For example:
extern thread_local constinit int x;
Clang and gcc do not emit suitable wrapper code to allow for x to trigger deferred initialization of other thread-local variables, which is non-conforming.
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2026-06-10 19:38:07 | admin | set | status: tentatively ready -> ready |
| 2026-05-30 05:56:01 | admin | set | status: open -> tentatively ready |
| 2023-01-15 12:07:04 | admin | set | messages: + msg7138 |
| 2023-01-06 00:00:00 | admin | create | |