This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 115e. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2024-11-11


717. Unintentional restrictions on the use of thread_local

Section: 9.2.2  [dcl.stc]     Status: CD2     Submitter: Clark Nelson     Date: 17 September, 2008

N2800 comment US 36

[Voted into WP at October, 2009 meeting.]

The current wording unintentionally restricts the use of the thread_local specifier in two contexts: block-scope extern variable declarations and static data members. These restrictions are in conflict with 9.2.2 [dcl.stc] paragraph 1.

Proposed resolution (July, 2009):

Change 9.2.2 [dcl.stc] paragraph 4 as follows:

The thread_local specifier shall be applied only to the names of objects or references of namespace scope and, to the names of objects or references of block scope that also specify extern or static, and to the names of static data members. It specifies that the named object or reference has thread storage duration (6.7.5.3 [basic.stc.thread]).