<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/58668>58668</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Clang accepts invalid program involving multiple template parameter packs
</td>
</tr>
<tr>
<th>Labels</th>
<td>
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
ranaanoop
</td>
</tr>
</table>
<pre>
The following invalid program is accepted by clang and gcc but correctly rejected by msvc: [Demo](https://godbolt.org/z/7WT6fe5n4).
```
template<typename... T1, typename... T2, typename... T3>
void foo(T1&&...args1, T2&&... args2, T3&&... args3) {
std::cout << "args1:\n", ((std::cout << args1 << " "), ...);
std::cout << "args2:\n", ((std::cout << args2 << " "), ...);
std::cout << "args3:\n", ((std::cout << args3 << " "), ...);
}
int main(int argc, char** argv)
{
foo(1,2,3,4,5,6); //gcc and clang compiles this while msvc correctly rejects this
};
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJytU8GSnCAQ_Rq8ULEURhwOHmZnki-YqpwRUElQLEC3Jl-fRmeyu9kcdqsyhU530_36If1ap27NddC4c9a6ZzP12EyrsEbh2bveixGbgIWUeo5a4faGpRWQJCaFeylxu0QsnfdaRnvDXv8AY88bwyoRPWFUPV306FB1QeQ4xDgHiCLyDVbvVOtszJ3vwfsFT_39yjpdTQdEeI6KCypO9zcr7mtzox5nK6JG9Bxvs57EqPM8x9cSkTN-EyHvIhTRrzvK6uCYnXNALFUyWJAhfB82nFR7j-EU3KCg_E0QXI5R_bQjYviFqNIJ6Uk6-DjAEBZGhOy4sFOdJ3ATGDSG9c-CLftVNd5KeKqC1smiH-xJPtWT_Jee9FM96Yd6ovryeiLMFPEoDLQ4JhNwZCqSg_CIwICdUmhNAPfqV9T3O0-XnOjBFZ5h4M4VPGzviO8DChOeJn2feenG2VgdcBxAE88D2NuUvxPAnvHC-s8JHkOc6aZkjHFGOWeZaqjilIssmmh1c94FtkkuvFfjtDq7Jp2Oi41mBg4PMeBZQIaO2oMlf4Zs8bb5S3EmDkubw0nAsXZ9_H0B-MQcXBPCogMY1ZGxYzY0bSfrrtWiqsviwFtFy47UUklVHGqmuMqsaLUNDQgdRJ6ZhhSElAV8X0ppWeVEScZpx3hJSl5qgg6FhouzeWqctJ_5ZuPQLn2ATWtCDC-bIgTTT1o_8MUSB-cbLyYhJufmbCPcbGx_A_NkX0Q">