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
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to