Skip to content

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

Description

@zygoloid

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions