================
@@ -1863,7 +1990,8 @@ checkForLastprivateConditionalUpdate(CodeGenFunction &CGF,
       const auto *DRE = dyn_cast<DeclRefExpr>(Ref->IgnoreParenImpCasts());
       if (!DRE)
         continue;
-      PrivateDecls.insert(cast<VarDecl>(DRE->getDecl()));
+      if (const auto *VD = dyn_cast<VarDecl>(DRE->getDecl()))
+        PrivateDecls.insert(VD);
       CGF.CGM.getOpenMPRuntime().checkAndEmitLastprivateConditional(CGF, Ref);
     }
   }
----------------
alexey-bataev wrote:

When DRE->getDecl() is a BindingDecl, the VD branch is skipped (correctly), but 
checkAndEmitLastprivateConditional still executes with a DeclRefExpr pointing 
to a BindingDecl. The runtime helper likely expects a VarDecl. Guard the call 
the same way you guarded the first linear block at ~line 1960-1975 (wrap both 
insert and conditional-check in the if (VD) block).

https://github.com/llvm/llvm-project/pull/190832
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to