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

Kiran Chandramohan via flang-commits flang-commits at lists.llvm.org
Tue Sep 24 05:28:19 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) {
----------------
kiranchandramohan wrote:

Is this only for taskgroup? Are there other constructs like this?

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


More information about the flang-commits mailing list