Created on 2006-11-30.00:00:00 last changed 130 months ago
[Voted into WP at August, 2010 meeting.]
Proposed resolution (March, 2010):
Change Clause 13 [temp] paragraph 4 as follows:
...Entities generated fromSpecializations (explicit or implicit) of a templatewiththat has internal linkage are distinct from allentities generatedspecializations in other translation units...
Notes from the April, 2007 meeting:
The CWG agreed that the linkage of an explicit specialization must be that of the template. Gabriel Dos Reis will investigate the reason for the different behavior of g++.
Given
template <class T> static T f(T t) { ... } template <> int f(int t) { ... }
what is the linkage of f(int)?
Section Clause 13 [temp] paragraph 4 says,
Entities generated from a template with internal linkage are distinct from all entities generated in other translation units.
But is the explicit specialization “generated from” the primary template? Does it inherit the local linkage? If so, where do I find a reference saying so explicitly?
James Widman: Data points: EDG 3.8 inherits, GCC 4.0 does not.
Mike Miller: There's a pretty strong presumption that the linkage of an explicit specialization cannot be different from that of its primary template, given that storage class specifiers cannot appear in an explicit specialization (9.2.2 [dcl.stc] paragraph 1).
History | |||
---|---|---|---|
Date | User | Action | Args |
2014-03-03 00:00:00 | admin | set | status: fdis -> c++11 |
2011-04-10 00:00:00 | admin | set | status: wp -> fdis |
2010-11-29 00:00:00 | admin | set | status: dr -> wp |
2010-08-23 00:00:00 | admin | set | messages: + msg2929 |
2010-08-23 00:00:00 | admin | set | status: ready -> dr |
2010-03-29 00:00:00 | admin | set | status: review -> ready |
2010-02-16 00:00:00 | admin | set | messages: + msg2564 |
2010-02-16 00:00:00 | admin | set | status: drafting -> review |
2007-05-06 00:00:00 | admin | set | messages: + msg1490 |
2007-05-06 00:00:00 | admin | set | status: open -> drafting |
2006-11-30 00:00:00 | admin | create |