<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/67244>67244</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [clang] Crash when mangling variadic concept after 4b163e343c
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            c++20,
            concepts,
            crash
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          BertalanD
      </td>
    </tr>
</table>

<pre>
    Compiling the following code results in an assertion failure on trunk (f1128f3782363ca26e0bdf9323a0d16570dcfba0):

```c++
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); }
```

```console
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 4b163e343c. @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.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycVNGOqzgPfppwYw2CpEC54GLazkhz8esc6e8LmMRAtiFBSZiZnqdfhXa2c6TdvVgJtcTY_r7Yn40h6NESdaw6sOqU4Ron57sD-YgG7Snrnbp2Rzcv2mg7QpwIBmeM-0gn6RSBp7CaGEBbQAsYAvmonYUBtVk9gbMQ_WovwPh-KEu-H0Sz56IWEnlNRa-GVnCBhSrrqimUHHosGG-ZeGbFiRVfv3VxeyTjh_Rs1kjzYjASE8d4XcjiTHBm_AhfpzzP4RyYeLn5S2dDpM_FQ--cgbfww9KPAZg4JY7ExOE75n_ILmmJ8Eh6B2DiuMWdQ57nyf0fcb7ctY0pILFk4gXOf2G8O61g8K63WqY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