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

    <tr>
        <th>Summary</th>
        <td>
            clang rejects valid `(T())(args...)` function call with pack expansion
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

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

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

<pre>
    ## Code to Reproduce
https://godbolt.org/z/Ef9P8fhP6
```cpp
template<typename T, typename... Args>
void f(Args... args) {
        (T())(args...);
}
```
## Output
```none
<source>: In function 'void f(Args ...)':
<source>:3:19: error: expected ')' before '...' token
    3 |         (T())(args...);
      |              ~ ^~~
      |                   )
```
## Explanation
`(T())(args...)` should be parsed as a:
- value-initialization of `T()`
- unnecessary parentheses
- pack expansion of the pack `args...` into the function call operator of `T`

This is how `(T())()` is interpreted (minus the pack expansion of course), and the same interpretation should apply to `(T())(args...)`.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMVE2P4jgQ_TWVS4nI2JCPQw4MDdKedrTqP-AkFeIdY1u20z09h_7tKyeB3kGz0xtFgF2vXr16xiVDUBdD1MD-C-yfMjnF0frmpAKZV_lCWWv7twa4AC7waHvCaPEvct72U0fAnoAdxhhdAHEAfgZ-vti-tTrm1l-An38AP5-G-ms1jF-LBQ4FW97OuWUn0tVpGQnEMb45MvJK-Az8iLdVnud48JcA4rRkvFjV4wC8SrspKlOU1wjll7UKq4FXz8Ar4PX8VnLBpoW4ocqnB1Hrcmn4zym6KT4gjDVr4yCOwU6-o6RLHPAPg8NkuqisQeDlTyJxrczL5NSv0gWIw7ZOPOS99fOP7466SH1iW5KxpcF6ShszYYnRfiOzECIiCoTyiLfnf1iwAv-VND_vCPvT-_tvMWuJ-ncWnr47LY1MnnzA_ltVwTCMdtI9toRO-kA9yoDybtoGX6SeaKOMikpq9WOmRjsgFOzGetOwwckY6igE6d8SHZk4UqBwCzvZfUsuSxNWljjSsgsFu-kqGCoT7Ry7H3AntUbryMto_b3-vfv583lUAVXA0b7iL_peG04YE8k7T8tZV1dlpvAh5SeBnZ18oJngiNL0MyykK3MnWSxZfZTO6bd0az8zPs_6RvS1qGVGzbaoeVnti2KfjU07yGFbDS2nti6HfhiGrqaKFYJVgslSZqrhjAtWcbFl2x3f520xFPuiFyXv-K6SW9gxukqlc61frmk0ZCqEiZpiV_Mi07IlHeYRxLmhV5yDwHmaSL5JOZt2ugTYMa1CDB8sUUVNTaeluaCnv6mLIf0_VP9ptw8H-ari-GB2NnndPMw2FcepzTt7BX5OItavjfM2FQd-nqUH4Oe5tX8CAAD__8MgiZo">