https://github.com/cabbaken created 
https://github.com/llvm/llvm-project/pull/173629

None

>From 2094ae7b945adf219258ecf046d90925f5a28541 Mon Sep 17 00:00:00 2001
From: RuoyuQiu <[email protected]>
Date: Fri, 26 Dec 2025 10:59:56 +0000
Subject: [PATCH] Fix openMP crash

Signed-off-by: RuoyuQiu <[email protected]>
---
 clang/lib/Sema/SemaOpenMP.cpp | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp
index 2a1337be13b99..002554a8e319c 100644
--- a/clang/lib/Sema/SemaOpenMP.cpp
+++ b/clang/lib/Sema/SemaOpenMP.cpp
@@ -6366,11 +6366,12 @@ StmtResult SemaOpenMP::ActOnOpenMPExecutableDirective(
         ArrayRef<Expr *> Exprs = ImplicitExprs;
         CXXScopeSpec MapperIdScopeSpec;
         DeclarationNameInfo MapperId;
+        OMPVarListLocTy Locs(StartLoc, StartLoc, StartLoc);
         if (OMPClause *Implicit = ActOnOpenMPMapClause(
                 nullptr, OMPC_MAP_MODIFIER_unknown, SourceLocation(),
                 MapperIdScopeSpec, MapperId, OMPC_MAP_tofrom,
                 /*IsMapTypeImplicit=*/true, SourceLocation(), SourceLocation(),
-                Exprs, OMPVarListLocTy(), /*NoDiagnose=*/true))
+                Exprs, Locs, /*NoDiagnose=*/true))
           ClausesWithImplicit.emplace_back(Implicit);
       }
     }
@@ -6383,12 +6384,12 @@ StmtResult SemaOpenMP::ActOnOpenMPExecutableDirective(
           continue;
         CXXScopeSpec MapperIdScopeSpec;
         DeclarationNameInfo MapperId;
+        OMPVarListLocTy Locs(StartLoc, StartLoc, StartLoc);
         auto K = static_cast<OpenMPMapClauseKind>(ClauseKindCnt);
         if (OMPClause *Implicit = ActOnOpenMPMapClause(
                 nullptr, ImpInfo.MapModifiers[I], ImplicitMapModifiersLoc[I],
                 MapperIdScopeSpec, MapperId, K, /*IsMapTypeImplicit=*/true,
-                SourceLocation(), SourceLocation(), ImplicitMap,
-                OMPVarListLocTy())) {
+                SourceLocation(), SourceLocation(), ImplicitMap, Locs)) {
           ClausesWithImplicit.emplace_back(Implicit);
           ErrorFound |= cast<OMPMapClause>(Implicit)->varlist_size() !=
                         ImplicitMap.size();

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

Reply via email to