[Bug c++/108299] toplevel thread_local variables are not initialized if not referenced and initialized at wrong moment when referenced
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Jan 5 15:40:34 GMT 2023
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108299
--- Comment #7 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Comment 0 seems wrong to me, there is no requirement that flag is initialized
if not odr-used, and if it is initialized, it doesn't have to happen before the
printf statement.
I agree that the standard says comment 3 should initialized both thread local
variables.
More information about the Gcc-bugs
mailing list