[clang] [Sema] Preserve ContainsUnexpandedParameterPack in TransformLambdaExpr (PR #86265)

Younan Zhang via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 25 07:09:23 PDT 2024


zyn0217 wrote:

> And we probably don't want the logic that produces diagnostics (substitutions cannot create new unexpanded packs in bad places), but we do need the logic to update the LambdaScopeInfo::ContainsUnexpandedPacks so we can avoid this extra traversal.

Cheers. Thanks for the advice. I added logic to TransformDeclStmt so that we can extract such a flag from TypeDecls. (Did I miss anything else? If any, we can probably leave them in the future as problems come up.)

The other challenging part is dealing with constraints. We need somehow to teach TransformCXXFoldExpr to recover the template arguments relative to the primary template so it can properly expand the fold expression. Anyway, I have made it work, though the approach is a bit tricky.

I will add more explanation to the codes tomorrow.

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


More information about the cfe-commits mailing list