Skip to content

[Clang] Variable template partial specialization cannot specialize primary template with auto NTTP #118190

@MagentaTreehouse

Description

@MagentaTreehouse

Reproducer:

template <auto> constexpr bool b = false;
template <int I> constexpr bool b<I> = true; 

Error:

<source>:2:33: error: variable template partial specialization does not specialize any template argument; to define the primary template, remove the template argument list
    2 | template <int I> constexpr bool b<I> = true;
      |                                 ^~~~

Possibly related: #42421.

See Compiler Explorer: https://godbolt.org/z/nEdbcKqWs

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:frontendLanguage frontend issues, e.g. anything involving "Sema"constexprAnything related to constant evaluationdiverges-from:edgDoes the clang frontend diverge from edg compiler on this issuediverges-from:gccDoes the clang frontend diverge from gcc on this issuediverges-from:msvcDoes the clang frontend diverge from msvc on this issue

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions