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

Zahira Ammarguellat via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 17 12:02:22 PDT 2026


================
@@ -19514,6 +19516,12 @@ static bool captureInLambda(LambdaScopeInfo *LSI, ValueDecl *Var,
     ByRef = (LSI->ImpCaptureStyle == LambdaScopeInfo::ImpCap_LambdaByref);
   }
 
+  if (auto *BD = dyn_cast<BindingDecl>(Var)) {
----------------
zahiraam wrote:

A lambda capturing a structured binding should always use the binding's own type not the decomposed type, regardless of OpenMP. This is C++ behavior.

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


More information about the cfe-commits mailing list