================
@@ -4672,43 +4672,81 @@ static bool
buildCapturedStmtCaptureList(Sema &S, CapturedRegionScopeInfo *RSI,
SmallVectorImpl<CapturedStmt::Capture> &Captures,
SmallVectorImpl<Expr *> &CaptureInits) {
+ bool HasError = false; // Track if any errors occurred.
+ llvm::SmallPtrSet<VarDecl *, 4> CapturedDecomposed;
for (const sema::Capture &Cap : RSI->Captures) {
if (Cap.isInvalid())
continue;
+ ValueDecl *CapVar = nullptr;
+ if (Cap.isVariableCapture()) {
+ CapVar = Cap.getVariable();
+ if (auto *BD = dyn_cast<BindingDecl>(CapVar)) {
+ if (RSI->CapRegionKind == CR_OpenMP && BD->getHoldingVar()) {
+ S.Diag(Cap.getLocation(), diag::err_capture_tuple_binding_openmp)
+ << CapVar;
+ S.Diag(CapVar->getLocation(), diag::note_entity_declared_at)
+ << CapVar;
+ HasError = true; // Mark error but continue.
+ continue; // Skip this capture, move to next.
----------------
alexey-bataev wrote:
Dead code?
https://github.com/llvm/llvm-project/pull/190832
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits