Skip to content

[clang] crashes when a concept is specialised as a class template #57415

@cjdb

Description

@cjdb

Problem
The following program crashes Clang and can be replicated using clang++ -std=c++20.

template<class T>
concept C = true;

template<class T>
class C<int> {};

Clang version
Confirmed on a4c8fb9.
Expected behaviour
Print an error message similar to the following.

/tmp/error.cpp:4:1: error: we attempted to specialise 'C' as a class template, but 'C' is a concept
class C<int>
      ^~~~~~
/tmp/error.cpp:1:1: note: first declared here
concept C = true;
        ^~~~~~~~

Metadata

Metadata

Assignees

No one assigned

    Labels

    c++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