[clang] [OpenMP] Support capturing structured bindings in OpenMP regions. (PR #190832)

Alexey Bataev via cfe-commits cfe-commits at lists.llvm.org
Sun May 24 10:53:13 PDT 2026


================
@@ -1970,9 +1970,14 @@ ExprResult Sema::BuildCaptureInit(const Capture &Cap,
   } else {
     assert(Cap.isVariableCapture() && "unknown kind of capture");
     ValueDecl *Var = Cap.getVariable();
+    // For OpenMP structured bindings, capture the decomposed decl, not the
+    // binding.
+    auto *BD = dyn_cast<BindingDecl>(Var);
----------------
alexey-bataev wrote:

Also, is this a dead code? Since you're resetting it to DecompositionDecl in SemaExpr.cpp

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


More information about the cfe-commits mailing list