[flang-commits] [flang] [Flang][OpenMP] Fixed semantic error when list item with a private da… (PR #109775)

via flang-commits flang-commits at lists.llvm.org
Tue Sep 24 06:14:01 PDT 2024


================
@@ -1540,8 +1540,15 @@ bool OmpAttributeVisitor::Pre(const parser::OpenMPBlockConstruct &x) {
   }
   if (beginDir.v == llvm::omp::Directive::OMPD_master)
     IssueNonConformanceWarning(beginDir.v, beginDir.source);
-  ClearDataSharingAttributeObjects();
-  ClearPrivateDataSharingAttributeObjects();
+
+  // The omp_taskgroup directive doesn't have its own data-sharing clauses.
+  // It inherits data-sharing attributes from the surrounding context.
+  // Therefore, don't clear the data-sharing attributes if it's an omp taskgroup
+  if (beginDir.v != llvm::omp::Directive::OMPD_taskgroup) {
----------------
kaviya2510 wrote:

yes, This is only for taskgroup.
All other construct which uses allocate clause other than taskgroup and allocators accepts datasharing attribute clauses as per Openmp 5.2 standard.
This case is already handled in allocators directive and this issue is only observed with allocate cause of taskgroup construct.


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


More information about the flang-commits mailing list