Skip to content

[concepts] explicit specialization 'template<>' syntax permitted when declaring a terse function template #50294

@zygoloid

Description

@zygoloid
mannequin
Bugzilla Link 50950
Version unspecified
OS All
CC @zygoloid

Extended Description

Clang incorrectly permits this syntax:

template<typename T> concept X = true;     
template<> void f(X auto x);

... treating the second line as the declaration of a function template. But 'template<>' always means an explicit specialization is being declared. We should diagnose the 'template<>' in this case and suggest that it be removed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillac++20clang:frontendLanguage frontend issues, e.g. anything involving "Sema"conceptsC++20 concepts

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions