cor3ntin wrote:

> Side note: lambdas don’t suffer from this problem because they push a new 
> LambdaScopeInfo, so if the lambda is discarded, the ‘enclosing lambda’ (which 
> is just that very same lambda) is discarded along with it. I’m not sure 
> making blocks work the same way would work (i.e. allowing unexpanded 
> parameter packs if there is an enclosing lambda or block, but I’m assuming 
> there is a reason why we don’t support that...), because currently, e.g. this 
> doesn’t work at all:

I am not sure i understand that.

Imo the issue is that `DiagnoseUnexpandedParameterPacks` (where we set 
`LambdaScopeInfo::ContainsUnexpandedParameterPack` does not account for blocks 
- and probably should.

Ideally
 - DiagnoseUnexpandedParameterPacks would handle arbitrary capturing-scope 
thingies (statement expressions, lambdas, blocks, eventually do expressions, 
and other terrifying such constructs)
 - Once the innermost such construct is fully constructed, the 
`ContainsUnexpandedParameterPack` flag could bubble upward to the enclosing 
capturing scope



https://github.com/llvm/llvm-project/pull/110762
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to