<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/56864>56864</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Failure to parse cast + fold expression
</td>
</tr>
<tr>
<th>Labels</th>
<td>
c++,
clang:frontend
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
rupprecht
</td>
</tr>
</table>
<pre>
Clang fails to parse a parameter pack expansion after a C-style cast:
```cpp
template <class... T>
void Test(std::tuple<T...>) {
(void) (F<T>(), ...);
}
```
Clang fails with:
```
<source>:8:21: error: expected expression
(void) (F<T>(), ...);
^
```
I believe, but I'm not sure, this may be a bug in Clang. Removing `(void)` or adding an extra set of parentheses allows Clang to parse it.
Compiler Explorer link: https://godbolt.org/z/zje9EG4WT
(reported internally)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJydU01zmzAQ_TVw2QkDEgZx4OA4difXjmd6FrAYJQIxknDs_vqucNJ8TNtDGQGr3dXy9r2lMd213mk5naCXSjvwBmZpHYIMbzmiR0tW-wx4meXklJlA9sEpYXfn_FUjtNL5iG-j9CFK355FelvtPN88HsdZS48Q8V2rpXNJksAx4vtb-GxUB0ekQkw434VyfOuXWSPlHyk3ZLIKovL-dgDootxwbvUzcQiZa5ogT8R2EI6RxV-PROXDF3QfIX9k4UX54W8dvW75zpnFthg-yLeCbpbRA9BaY1fjMmPrsQuGRReY-2_k8Icr2uz_0c0jNKgVnjFUaxYPjxErR5iMB7fY1esH5WCUV8okMZvlBGqClYUEvuNozor4CGV_Y6UNGFK-60JITtSatxIcejB9mBec_IAOHUitzYu7VXufKeWTT4ybcVaaRml_mbWxZGg1PQfuBu9nFwRgB1on0zVG-8TYE-1-hvsJq_23_Mfxk0JMWJyNDZyriUZ0IhRXgh1jnRWbiossL6q4q3lX8UrGXnmN9YEEJ0LeQYZpJlHuoTf6o3jxYnX9BRiNydIkrRlpo_X57XU3W_NE4tNWObegI2NTiCKPh1o2WZc1mHLBeCYylpdFX0mBOe9EUbZ5rCUp5-pocx8x1hKQdbGgWHAERglAbw21OHUhsnmIVc1SxlKRZlmVlblImrZvyhQb0fE-bfkmylMcqdUk4AtMxrZeoZLujoJaOe_eg_R_qtOEuMKg-nLxg7G1XWaiox18vPZVr039Ai_4P-U">