Skip to content

template <auto> doesn't work with partial specialization #42421

@llvmbot

Description

@llvmbot
Bugzilla Link 43076
Version trunk
OS Windows NT
Reporter LLVM Bugzilla Contributor
CC @Quuxplusone,@kamleshbhalui,@ldalessa,@zygoloid

Extended Description

Example:

template <auto> struct foo { static constexpr int value = 0; };
template <int I> struct foo<I> { static constexpr int value = 1; };

static_assert(foo<42L>::value == 0);

According to clang, foo<42L>::value is 1, but the partial specialization should not match here (we fail [temp.deduct.type]/19 because the type of 42L differs from the type of the parameter).

Metadata

Metadata

Assignees

Labels

bugzillaIssues migrated from bugzillac++17clang:frontendLanguage frontend issues, e.g. anything involving "Sema"confirmedVerified by a second party

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions