[flang-commits] [flang] [FLANG][OMP] Add error message for invalid dependence type in taskwait construct (#219234). (PR #220837)
via flang-commits
flang-commits at lists.llvm.org
Thu Sep 3 01:03:55 PDT 2026
https://github.com/laoshd created https://github.com/llvm/llvm-project/pull/220837
This PR is to fix #219234.
>From 9b342c5102a628f551ab2acc2314cea0ccc08558 Mon Sep 17 00:00:00 2001
From: Shandong Lao <shandong.lao at hpe.com>
Date: Thu, 3 Sep 2026 02:59:54 -0500
Subject: [PATCH] [FLANG][OMP] #219234: Add error message for invalid
dependence type in taskwait construct.
---
flang/lib/Semantics/check-omp-structure.cpp | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/flang/lib/Semantics/check-omp-structure.cpp b/flang/lib/Semantics/check-omp-structure.cpp
index 274efa64d03d0..762c9bf8a9be7 100644
--- a/flang/lib/Semantics/check-omp-structure.cpp
+++ b/flang/lib/Semantics/check-omp-structure.cpp
@@ -5116,6 +5116,14 @@ void OmpStructureChecker::Enter(const parser::OmpClause::Depend &x) {
context_.Say(GetContext().clauseSource,
"The SINK and SOURCE dependence types can only be used with the ORDERED directive, used here in the %s construct"_err_en_US,
parser::omp::GetUpperName(dir, version));
+ } else if (dir == llvm::omp::OMPD_taskwait &&
+ taskDep->GetTaskDepType() ==
+ parser::OmpTaskDependenceType::Value::Mutexinoutset) {
+ // A depend clause on a taskwait construct must not have
+ // mutexinoutset as dependence-type.
+ context_.Say(GetContext().clauseSource,
+ "A DEPEND clause on a TASKWAIT construct must not have %s as dependence type"_err_en_US,
+ "MUTEXINOUTSET");
}
}
if (taskDep) {
More information about the flang-commits
mailing list