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

    <tr>
        <th>Summary</th>
        <td>
            Clang rejects valid program involving parameter packs with in between type
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang
      </td>
    </tr>

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

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

<pre>
    The following program is rejected by clang while both gcc and msvc accepts this. [Demo](https://godbolt.org/z/rjxP9bM5P)

```
#include <type_traits>

template <typename... T>
struct args_tag
{
 using type = std::common_type_t<T...>;
};

template <typename... T>
void bar(args_tag<T...>, std::type_identity_t<T>..., int, std::type_identity_t<T>...) {}


// example
int main() {
 bar(args_tag<int, int>{}, 4, 8, 15, 16, 23);
   
}
```
Clang says:

```
<source>:15:5: error: no matching function for call to 'bar'
   15 |     bar(args_tag<int, int>{}, 4, 8, 15, 16, 23);
      | ^~~
<source>:10:6: note: candidate template ignored: deduced packs of different lengths for parameter 'T' (<int, int> vs. <>)
   10 | void bar(args_tag<T...>, std::type_identity_t<T>..., int, std::type_identity_t<T>...) {}
      |      ^
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzEVMGOozgQ_RpzKQ0idsDhwCFNkttKc-h7y9gV8KyxkW3Skz3Mt68M6bDbO1rNYaWNkrKDyq569R5PhKB7i9iQ8oWUp0zMcXC-8cIKYZ2bss6pe_M6IFydMe5d2x4m73ovRtABPH5DGVFBdwdphO3hfdAGoXNxgF5KEFbBGG4ShJQ4xQBx0CEHUr6ccHSkPBF6GGKcAmFHQi-EXnqnOmdi7nxP6OUPQi_-2_evdfdb-ZXQmhQnUhwfsSoe3_UvZdpKMysEwtp4n_AteqFjIOz812MRx8mI-MyyYsQ8z-H1mRein2UE4fvwFkX_OMxf1g3MIU0hHQXCThCiSs2zo3Tj6OzbWpmw9jXP83Qne_m44bTtf7GVm9MKOuEJPTzb2W6m7VZ9KasV2qjjfa1P2Dkl0ha0jb-aXENCyk9_m_RjwIkfwO9inAyuz7SNMAptCT18HF2H9I-eHy2khZ0fJWgL-xQOKezKJVYpUpa4_hgWAGwT_Bn17SK9IO6LjP5FIqwNbvYSF1qOu5KwY_oBeu982lgHo4hySAxfZyujdhauzoMUxkB0QChfoPFna7sSCG8hff5j0Ak3b4GU5x8_fg6gIOxYrX1HTKsUVmmVJPXUlu6t85iIB4VqlqhgEvL3AO4KSl-v6NFGMGj7OIQF6yS8GDGiT2hfCeWQ6P2EBm7pPWbtosN6m0ax9Px_63ab3ropz58EkamGqZrVIsNmx4uyLIqCV9nQ1OUBhdwLVUjBacWYkh2vasH3Na_LapfphhZ0X-x2fJdimVeK1yVTqISqeCc52Rc4Cm1yY25j8rFMhzBjww_7fZ0Z0aEJi99SungmoTRZr29S_pdu7gPZF0aHGLYboo4Gm1Xnq-kGuAmj1ebG9ubMbfHnJ30rz-86DqAtdBjfEe3iXNnsTfPJeHUc5i6XbiT0kgo_li-Td6kgoZcFRyD0skD5MwAA__-nCtAx">