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

Alexey Bataev via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 18 06:37:16 PDT 2026


================
@@ -1168,11 +1154,43 @@ bool CodeGenFunction::EmitOMPFirstprivateClause(const OMPExecutableDirective &D,
     const auto *IRef = C->varlist_begin();
     const auto *InitsRef = C->inits().begin();
     for (const Expr *IInit : C->private_copies()) {
-      const auto *OrigVD = cast<VarDecl>(cast<DeclRefExpr>(*IRef)->getDecl());
+      const auto *OrigDecl = cast<DeclRefExpr>(*IRef)->getDecl();
+      const VarDecl *OrigVD = dyn_cast<VarDecl>(OrigDecl);
----------------
alexey-bataev wrote:

Move it closer to the actual use, line 1189

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


More information about the cfe-commits mailing list