[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 9 07:00:05 PST 2025


================
@@ -3423,6 +3425,30 @@ VarDecl *BindingDecl::getHoldingVar() const {
   return VD;
 }
 
+void DecompositionDecl::VisitHoldingVars(
+    llvm::function_ref<void(VarDecl *)> F) const {
+  VisitBindings([&](BindingDecl *BD) {
+    if (VarDecl *VD = BD->getHoldingVar())
+      F(VD);
+  });
+}
+
+void DecompositionDecl::VisitBindings(
----------------
erichkeane wrote:

This one is a bit more complicated?  But I'd be surprised if there isn't an existing llvm iterator that can do this. 

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


More information about the cfe-commits mailing list