<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/84857>84857</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Failure to match multiple parameter packs
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Boris-Rasin
</td>
</tr>
</table>
<pre>
Fails to compile on clang 18.1.0, works on gcc 13.2 and msvc 19.38:
```c++
template <typename T, template<typename...> class C, typename ...Ts>
constexpr bool is_template = false;
template <template<typename...> class C, typename ...Ts, typename ...Xs>
constexpr bool is_template<C<Ts..., Xs...>, C, Ts...> = true;
template <typename T, typename X = long>
struct test;
bool b = is_template<test<int>, test, int>;
```
Incidentally, this version works, which should not work (and doesn't work on gcc and msvc).
gcc and msvc correctly diagnose: "error: parameter pack must be at the end of the template parameter list"
```c++
template <typename T, template<typename...> class C, typename ...Ts>
constexpr bool is_template = false;
template <template<typename..., typename...> class C, typename ...Ts, typename ...Xs>
constexpr bool is_template<C<Ts..., Xs...>, C, Ts...> = true;
template <typename T, typename X = long>
struct test;
bool b = is_template<test<int>, test, int>;
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsVEFvozoQ_jXmMioyhiTkwKEhjfSuTzn09mTMBPxqbOQx7ebfr-wkbdrDanePq5UsMN94vvk0_hhJpAeL2LDVjq32mVzC6Hyzc17Tw7-StM0615-bg9SGIDhQbpq1QXAWlJF2gKLOi5wz0cKb8y8UA4NSUJS5AGl7mOhVQbHNy5qVj4zvGb891_yyFBO7uBIacJqNDAisbMN5RisnhGOkv0XuAnmes_IpCiGCNh26peR5fiRWPl1YlbMU8NvsoXPOgKb_7urs4SQNISt39_I-CfmN0l-Q558Rw8q2ZWV7pMguWnimS5m4TzWOVyCpDn75oejP3bt9Padc4-zwLoiCX1SAgBS-8CWBXcr4LPNyttU2XOUlQLRwRd5pbpd8z_qPVbpHG6Qx55Q7aoJX9KSdvbgo2WnUagQa3WJ6sC6kCDBRR1f1DskysbmiV9Pd_MbENr-UukdBOe9RBXOGXsvBunjnj8CEQO-dj_tZejlhQA-zVC8wLRSgQ5ABwoiAtgd3Stv3Rn9kGB07IP4si9_V--v4X3N81jdlvy23MsOm2BRccFGIIhubbSWFXPdSyAo3BW66arWtV_2pXnEpsCgy3QguKl4WgnNeV0Ve9-vu1PG1UHJdr08dqzhOUpvcmNcpd37INNGCTV3Vq01mZIeG0kQXwuIbpGC05mqf-SbmPHTLQKzi0bP0wRJ0MJhm_eIxTvtJBjXCtJigZ4Nffg_KFm-aMYSZ4mgXByYOgw7j0uXKTUwcIu_19TB79z-qwMQhqSEmDknt9wAAAP__PrMBpQ">