https://github.com/animeshk-amd created https://github.com/llvm/llvm-project/pull/82220
This patch fixes the #67002 ([OpenMP][Clang] Scan Directive not supported for Generic types). It disables the Sema checks/analysis that are run on the helper arrays which go into the implementation of the `omp scan` directive until the template instantiation happens. Grateful to @alexey-bataev for suggesting these changes. >From 92ce8475d7c5b30d1c46f11cb85707b6e7d70f71 Mon Sep 17 00:00:00 2001 From: Animesh Kumar <animesh.ku...@amd.com> Date: Mon, 19 Feb 2024 00:28:39 -0600 Subject: [PATCH] [OpenMP][Clang] Enable inscan modifier for generic datatypes This patch fixes the #67002 ([OpenMP][Clang] Scan Directive not supported for Generic types). It disables the Sema checks/analysis that are run on the helper arrays which go into the implementation of the `omp scan` directive until the template instantiation happens. --- clang/lib/Sema/SemaOpenMP.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp index 7f75cfc5b54f35..f4364a259ad57f 100644 --- a/clang/lib/Sema/SemaOpenMP.cpp +++ b/clang/lib/Sema/SemaOpenMP.cpp @@ -4962,7 +4962,8 @@ StmtResult Sema::ActOnOpenMPRegionEnd(StmtResult S, if (RC->getModifier() != OMPC_REDUCTION_inscan) continue; for (Expr *E : RC->copy_array_temps()) - MarkDeclarationsReferencedInExpr(E); + if (E) + MarkDeclarationsReferencedInExpr(E); } if (auto *AC = dyn_cast<OMPAlignedClause>(C)) { for (Expr *E : AC->varlists()) _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits