Skip to content

CWG2916 [temp.spec.partial] variable template partial specializations can be declared static #580

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
zygoloid opened this issue Jul 24, 2024 · 1 comment

Comments

@zygoloid
Copy link
Member

Reference (section label): [temp.spec.partial]

Link to reflector thread (if any): http://lists.isocpp.org/core/2024/07/16057.php

Issue description:

There appears to be no prohibition on applying the static storage class specifier to a variable template partial specialization. Implementations accept this, and despite [basic.link] clearly saying that the name of the template has linkage rather than its specializations, they give specializations instantiated from a static partial specialization internal linkage even if the template has external linkage.

Suggested resolution:

Add a rule

A partial specialization declaration for a variable shall not have the storage-class-specifier static.

at a suitable place within [temp.spec.partial]. I would suggest not prohibiting extern as forward-declaring partial specializations is useful, per the primary topic of the above-mentioned reflector thread.

@jensmaurer jensmaurer changed the title [temp.spec.partia] variable template partial specializations can be declared static [temp.spec.partial] variable template partial specializations can be declared static Jul 29, 2024
@jensmaurer jensmaurer changed the title [temp.spec.partial] variable template partial specializations can be declared static CWG2916 [temp.spec.partial] variable template partial specializations can be declared static Jul 29, 2024
@jensmaurer
Copy link
Member

CWG2916

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants