CWG Issue 1648 (original) (raw)
This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 117a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2025-04-13
1648.thread_local vs block extern declarations
Section: 9.2.2 [dcl.stc]Status: C++14Submitter: Richard SmithDate: 2013-04-12
[Moved to DR at the September, 2013 meeting.]
According to 9.2.2 [dcl.stc] paragraph 4,
When thread_local is applied to a variable of block scope the storage-class-specifier static is implied if it does not appear explicitly.
This, presumably unintentionally, prohibits a declaration like
void f() { extern thread_local int n; }
Proposed resolution (April, 2013):
When thread_local is applied to a variable of block scope the storage-class-specifier static is implied if
it does not appear explicitlyno other_storage-class-specifier_ appears in the_decl-specifier-seq_.