[clang] [OpenMP] Support capturing structured bindings in OpenMP regions. (PR #190832)
Zahira Ammarguellat via cfe-commits
cfe-commits at lists.llvm.org
Tue Jun 9 08:30:31 PDT 2026
================
@@ -1152,11 +1154,38 @@ 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);
+ const auto *VD = cast<VarDecl>(cast<DeclRefExpr>(IInit)->getDecl());
+
+ if (const auto *BD = dyn_cast<BindingDecl>(OrigDecl)) {
+ const auto *VDInit =
+ cast<VarDecl>(cast<DeclRefExpr>(*InitsRef)->getDecl());
----------------
zahiraam wrote:
Fixed.
https://github.com/llvm/llvm-project/pull/190832
More information about the cfe-commits
mailing list