Created on 2024-04-24.00:00:00 last changed 2 months ago
Additional notes (August, 2024)
If the primary template is declared static, the least breakage of existing code occurs if the partial specialization is required to also be declared static.
Possible resolution:
Add before 13.7.6.1 [temp.spec.partial.general] paragraph 10 as follows:
A partial specialization declaration for a variable template shall give its name the same linkage as the declaration of the primary template. A partial specialization declaration for a static data member template shall have the storage-class-specifier static.
The usual access checking rules do not apply to non-dependent names used to specify template arguments of the simple-template-id of the partial specialization. ...
Proposed resolution (approved by CWG 2024-08-16): [SUPERSEDED]
Add before 13.7.6.1 [temp.spec.partial.general] paragraph 10 as follows:
A partial specialization declaration for a variable template shall not have the storage-class-specifier static.
The usual access checking rules do not apply to non-dependent names used to specify template arguments of the simple-template-id of the partial specialization. ...
(From submission #580.)
There appears to be no prohibition on applying the static storage class specifier to a variable template partial specialization. However, 6.6 [basic.link] clearly says that the name of the template has linkage (not its specializations). Implementations give specializations instantiated from a static partial specialization internal linkage even if the template has external linkage. This is undesirable.
History | |||
---|---|---|---|
Date | User | Action | Args |
2024-08-29 21:20:31 | admin | set | messages: + msg7810 |
2024-08-29 21:20:31 | admin | set | status: tentatively ready -> review |
2024-08-16 19:45:15 | admin | set | status: open -> tentatively ready |
2024-07-29 22:31:57 | admin | set | messages: + msg7776 |
2024-04-24 00:00:00 | admin | create |