[clang] [Clang][Sema] Fix an ICE where structured binding packs within a lambda were not added to the CapturingScopeInfo (PR #214716)

via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 10 11:46:31 PDT 2026


================
@@ -914,6 +914,12 @@ Sema::ActOnDecompositionDeclarator(Scope *S, Declarator &D,
 
     auto *BD = BindingDecl::Create(Context, DC, B.NameLoc, B.Name, QT);
 
+    if (BD->isParameterPack()) {
+      if (auto *CSI = getEnclosingLambdaOrBlock()) {
+        CSI->LocalPacks.push_back(BD);
+      }
+    }
----------------
babadany2999 wrote:

Thanks! I did read the coding standards but I code a bit differently so it slipped!

https://github.com/llvm/llvm-project/pull/214716


More information about the cfe-commits mailing list