[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
Sun Sep 29 23:13:39 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:

Hi @kiranchandramohan, 
Hope you have read my comments. Please do let me know if it needs any further changes.

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


More information about the flang-commits mailing list