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

    <tr>
        <th>Summary</th>
        <td>
            [clang] Poor error recovery when performing pack expansion on expressions
        </td>
    </tr>

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

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

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

<pre>
    Repro: https://godbolt.org/z/K6s7W6d8z
```
template <class> struct A;
template <class> using B = char;
template <class Cs> int C{ A<B<Cs>>{}... };
```

We incorrectly diagnose a pack expansion without unexpanded parameter packs:
```
<source>:3:28: error: implicit instantiation of undefined template 'A<char>'
template <class Cs> int C{ A<B<Cs>>{}... };
                           ^
<source>:1:25: note: template is declared here
template <class> struct A;
                        ^
<source>:3:38: error: pack expansion does not contain any unexpanded parameter packs
template <class Cs> int C{ A<B<Cs>>{}... };
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy1VE1v2zAM_TXyRZjhSPHXwYc4yS67DLv0LFu0rdWWDElOl_z6UU7aYkFboEBnSKZI0eR7lOjGyHP1C2ZrCN_RwfvZ4YKw7zh6Ixsz-tjYHrULzh-Zyx8yWVxIciDJjmTJbayqh2kehQdK-L4dhcNIR-q8XVpPd4TXH3gtTume1mg70HYQ9n1vul8_UNrTPcnrEHhf41zNYeQ1yQ9xHFMUL2HukF7fD4BhWmMttH48U6lEr40DKugs2kcKf2ahnTKaPik_mMXTRa82CRI9rJjAg11915q9mYjvnVlsCyu4HcfJilBpsNbYsFDIT7XKIxTnhfZK-JDSdJhNQqc0JnstAstDyGuFjqh9aZHo-w9Jj28S2gRCaeChjYcgX7AoRyUgGosEBrDwmTvyWRihrvzfut4doTTgAkbaGu2F0lTo80fn-V8uXwTVJsuyMk-2WRnJisuSlyLyyo9QkbTGHLon6YH-NMZeqVC8nOYE9kyfBtB0BtsZO4VmuSOIAxULLmguWuxY3XUzXuKliVszoTKOp2fxDXv_N3YAqsq5BRwu0iLLeTRUQiQS0fKGp9kW3yUwgIKVGU8KKEsejaKB0QXshLErfL7rLNYYtEQTkolUxRLGNgkrNimKMk64kC3vWNLmHQgmyTaBSagxDnDC3yay1YqsWXqHm6Ny3r1u4jmoXgPcsk7qcoJHc7plEwv2qq2erdHKqVoJ_QVoing6">