Skip to content

[clang] Crash when mangling variadic concept after 4b163e343c #67244

@BertalanD

Description

@BertalanD

Compiling the following code results in an assertion failure on trunk (f1128f3):

template<typename T, typename... Ts>
constexpr bool IsOneOf = true;

template<typename T, typename... Ts>
concept OneOf = IsOneOf<T, Ts...>;

template<OneOf<int, bool> T>
void frobnicate(T val) {}

void test() { frobnicate(1); }
Assertion failed: (getExpandedPackSize(Param) && "failed to form pack argument for parameter pack"), function getArgInfo, file ItaniumMangle.cpp, line 5797.

The crash goes away when -fclang-abi-compat=17 is specified, so this regression likely comes from 4b163e3. @zygoloid

It looks like Compiler Explorer's Clang trunk build does not include this commit as of now, so I can't share a link to a live reproducer. But only the -std=c++20 argument should be necessary to get it to appear. The issue can be seen on the "assertions trunk" builds:

https://godbolt.org/z/n8vqehhfj

Metadata

Metadata

Assignees

No one assigned

    Labels

    c++20clang:codegenIR generation bugs: mangling, exceptions, etc.conceptsC++20 conceptscrashPrefer [crash-on-valid] or [crash-on-invalid]

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions