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


2232. thread_local anonymous unions

Section: 9.2.2  []     Status: open     Submitter: Mike Herrick     Date: 2016-02-23

It is not clear from the current wording whether the thread_local specifier can be applied to anonymous unions or not. According to 9.2.2 [] paragraph 3,

The thread_local specifier indicates that the named entity has thread storage duration ( []). It shall be applied only to the names of variables of namespace or block scope and to the names of static data members.

One might think that an anonymous union object would be a “variable,” but the next paragraph seems to treat variables and anonymous unions as distinct:

The static specifier can be applied only to names of variables and functions and to anonymous unions (11.5.2 [class.union.anon]).