Closed
Description
How to reproduce
struct Base
{
consteval virtual int Get() const = 0;
};
struct Derived : Base
{
consteval int Get() const override
{
return 42;
}
};
int main()
{
constexpr Derived a;
auto val = a.Get();
return 0;
}
Compiler explorer link (clang-14, -std=c++20, no optimizations or other options):
https://godbolt.org/z/vhqGqvf1z
Replacing 'consteval' with 'constexpr', moving a
creation out of the function scope or removing inheritance seems to fix this compiler crash.
Attached cpp/sh crash reproduction files from my local compiler (clang 13.0.1-2 from Arch Linux repos):
main-fee9e9..zip
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done