[flang-commits] [flang] [Flang][OpenMP] Allow copyprivate and nowait on the directive clauses (PR #127769)

Michael Klemm via flang-commits flang-commits at lists.llvm.org
Mon Feb 24 08:40:56 PST 2025


================
@@ -1203,6 +1203,39 @@ void OmpStructureChecker::Enter(const parser::OpenMPBlockConstruct &x) {
     deviceConstructFound_ = true;
   }
 
+  if (GetContext().directive == llvm::omp::Directive::OMPD_single) {
+    bool foundCopyPrivate{false};
+    bool foundNowait{false};
+    parser::CharBlock NowaitSource{""};
+    auto catchCopyPrivateNowaitClauses = [&](const auto &dir) {
+      for (auto &clause : std::get<parser::OmpClauseList>(dir.t).v) {
+        if (clause.Id() == llvm::omp::Clause::OMPC_copyprivate) {
+          if (foundCopyPrivate) {
----------------
mjklemm wrote:

This condition is incorrect and needs to be tied to the list-items in the `copyprivate` clause. Several `copyprivate` clauses can be at the directive, as long as they have different list-items.

https://github.com/llvm/llvm-project/pull/127769


More information about the flang-commits mailing list