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


1869. thread_local vs linkage-specifications

Section: 9.11  [dcl.link]     Status: NAD     Submitter: Richard Smith     Date: 2014-02-14

According to 9.11 [dcl.link] paragraph 7,

A declaration directly contained in a linkage-specification is treated as if it contains the extern specifier (9.2.2 [dcl.stc]) for the purpose of determining the linkage of the declared name and whether it is a definition. Such a declaration shall not specify a storage class.

This prohibits a declaration like

  extern "C++" thread_local int n;

Should this be changed?

Rationale (June, 2014):

This restriction is the same for static and simply requires that the braced form of linkage-specification be used.