================
@@ -454,6 +462,11 @@ Sema::DiagnoseUnexpandedParameterPacks(SourceLocation Loc,
       };
       if (llvm::any_of(CSI->LocalPacks, DeclaresThisPack))
         ParamPackReferences.push_back(Pack);
+
+      // Structured binding packs should not participate in delayed lambda
+      // diagnostics, and should instead be diagnosed immediately
----------------
babadany2999 wrote:

You're right. That is a valid pack expansion and the lambda should be allowed 
to have delayed diagnostics.
According to [[temp.variadic]](https://eel.is/c++draft/temp.variadic), 
specifically `p6` and `p6.17`:
`[...] Pack expansions can occur in the following contexts:`
- `p6.17`: `In a [fold-expression] ([expr.prim.fold]); the pattern is the 
[cast-expression] that contains an unexpanded pack`

And by `p8`:
`A pack whose name appears within the pattern of a pack expansion is expanded 
by that pack expansion[...]` and `An appearance of a name of a pack that is not 
expanded is ill-formed` (which also proves that #214160 is ill-formed) and from 
[[expr.prim.fold]](https://eel.is/c++draft/expr.prim.fold) makes it a valid 
right unary fold.

https://github.com/llvm/llvm-project/pull/214716
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to