Created on 2013-10-02.00:00:00 last changed 94 months ago
[Moved to DR at the November, 2014 meeting.]
Proposed resolution (February, 2014):
Change 9.2.2 [dcl.stc] paragraph 1 as follows:
...A storage-class-specifier other than thread_local shall not be specified in an explicit specialization (13.9.4 [temp.expl.spec]) or an explicit instantiation (13.9.3 [temp.explicit]) directive.
According to 9.2.2 [dcl.stc] paragraph 1,
...If thread_local appears in any declaration of a variable it shall be present in all declarations of that entity... A storage-class-specifier shall not be specified in an explicit specialization (13.9.4 [temp.expl.spec]) or an explicit instantiation (13.9.3 [temp.explicit]) directive.
These two requirements appear to be in conflict when an explicit instantiation or explicit specialization names a thread_local variable. For example,
template <class T> struct S { thread_local static int tlm; }; template <> int S<int>::tlm = 0; template <> thread_local int S<float>::tlm = 0;
which of the two explicit specializations is correct?
History | |||
---|---|---|---|
Date | User | Action | Args |
2017-02-06 00:00:00 | admin | set | status: drwp -> cd4 |
2015-05-25 00:00:00 | admin | set | status: dr -> drwp |
2015-04-13 00:00:00 | admin | set | messages: + msg5355 |
2014-11-24 00:00:00 | admin | set | status: ready -> dr |
2014-03-03 00:00:00 | admin | set | messages: + msg4818 |
2014-03-03 00:00:00 | admin | set | status: open -> ready |
2013-10-02 00:00:00 | admin | create |