[clang] [clang][Sema] Ignore the parentheses in the guard of DiagnoseUnexpandedParameterPack (PR #86401)

Younan Zhang via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 28 19:19:12 PDT 2024


zyn0217 wrote:

@dwblaikie : You're right. The patch is insufficient because the `FunctionParmPackExpr` in your example could also be wrapped with e.g.
```
CallExpr 0x5555649b0cf0 '<dependent type>'
|-UnresolvedLookupExpr 0x5555649af8f8 '<overloaded function type>' lvalue (ADL) = 'f1' 0x555564990e98
`-FunctionParmPackExpr 0x5555649af9c0 'Ts...' lvalue
```
... a CallExpr.

Admittedly, I don't like the way that this and previous fixes have taken: the assertion we have run into *really* seems unnecessary because the following `DiagnoseUnexpandedParameterPacks` handles the empty pack cases. In my first attempt, I proposed to remove these assertions, while Corentin worried that they could hide other issues, which I have agreed with because, indeed, we have many bugs that the crash locations are not where the underlying problems lurk.

Either way, I think I'm going to take a deeper look, probably I should think of a more optimal approach instead of adding such "whack a mole" fixes. I will turn it to draft, probably these issues will get fixed together with my https://github.com/llvm/llvm-project/pull/86265 - I'll notify you when everything is ready.


https://github.com/llvm/llvm-project/pull/86401


More information about the cfe-commits mailing list