ilya-biryukov wrote:

> This patch resolves it by visiting the body twice (of course, it's 
> suboptimal), however patch #99882 still crashes because that relies on the 
> mechanism above, I believe.

I have also observed it crashes, but I still think that in principle we don't 
need to traverse the body twice. If `DeclStmt` calls `DiagnoseUnexpandedPacks`, 
it will set the correct flag on the inner `LambdaScopeInfo`, which should later 
be available in the `LambdaExpr` itself, and can either be "consumed" by 
`CXXFoldExpr` (as in the example test case) or propagated into the outer 
`LamdaScopeInfo` from another call to `DiagnoseUnexpandedPacks`.
I believe that's what's already happening during parsing, but we seem to 
somehow miss setting this flag during substitution.

Are we crashing because we are missing calls to `DiagnoseUnexpandedPacks` 
during substitution or because we don't set up the `LambdaScopeInfo` during 
substitution correctly?

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