[clang] [Sema] Preserve ContainsUnexpandedParameterPack in TransformLambdaExpr (PR #86265)
Ilya Biryukov via cfe-commits
cfe-commits at lists.llvm.org
Wed Jul 24 09:21:26 PDT 2024
ilya-biryukov wrote:
Looking at the code a bit deeper, I think (not 100% sure) we're not calling `DiagnoseUnexpandedPacks` during substitution.
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.
We might want to extract the function that only does the `LambdaScopeInfo::ContainsUnexpandedPacks` and call it instead of the fully-fledged `DiagnoseUnexpandedPacks`, and call it at the right places during substitutions. Tracking down all of them might be tricky, though.
Another alternative is to add a `ContainsUnexpandedPacks` flag to statements, but that is probably even harder than the former suggestion.
The third alternative is to keep the extra traversal for now. It's probably the simplest option.
https://github.com/llvm/llvm-project/pull/86265
More information about the cfe-commits
mailing list