Title
thread_local anonymous unions
Status
open
Section
10.1.1 [dcl.stc]
Submitter
Mike Herrick

Created on 2016-02-23.00:00:00, last changed 2016-02-23.00:00:00.

Messages

Date: 2018-02-27.00:00:00

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

The thread_local specifier indicates that the named entity has thread storage duration (6.7.2 [basic.stc.thread]). 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 (12.3.1 [class.union.anon]).
History
Date User Action Args
2016-02-23 00:00:00admincreate