Skip to content

Class template partial specialization with concept-auto non-type parameter is not supported #77377

Closed
@Fedr

Description

@Fedr

In this program

#include <concepts>

template <auto>
struct A;

template <std::same_as<int> auto p>
struct A<p> {};

A<0> a;

A<auto> is a class template with non-type parameter, and A<std::same_as<int> auto> is its specialization for int parameters. The program is accepted by GCC and MSVC, but Clang complains:

error: class template partial specialization is not more specialized than the primary template [-Winvalid-partial-specialization]

Online demo: https://godbolt.org/z/ee4TcPY5K

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:frontendLanguage frontend issues, e.g. anything involving "Sema"conceptsC++20 conceptsconfirmedVerified by a second party

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions