[flang-commits] [flang] [Flang][OpenMP] Fix for threadprivate check in copyin clause (PR #181354)

via flang-commits flang-commits at lists.llvm.org
Fri Feb 13 04:43:59 PST 2026


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-flang-openmp

Author: Kiran Chandramohan (kiranchandramohan)

<details>
<summary>Changes</summary>

Use the ultimate symbol in the threadprivate check

Fixes #<!-- -->180094

---
Full diff: https://github.com/llvm/llvm-project/pull/181354.diff


1 Files Affected:

- (modified) flang/lib/Semantics/resolve-directives.cpp (+3-4) 


``````````diff
diff --git a/flang/lib/Semantics/resolve-directives.cpp b/flang/lib/Semantics/resolve-directives.cpp
index 1fde0d62581e8..147a17a31b59f 100644
--- a/flang/lib/Semantics/resolve-directives.cpp
+++ b/flang/lib/Semantics/resolve-directives.cpp
@@ -3465,10 +3465,9 @@ void ResolveOmpParts(
 }
 
 static bool IsSymbolThreadprivate(const Symbol &symbol) {
-  if (const auto *details{symbol.detailsIf<HostAssocDetails>()}) {
-    return details->symbol().test(Symbol::Flag::OmpThreadprivate);
-  }
-  return symbol.test(Symbol::Flag::OmpThreadprivate);
+  const Symbol &ultimate{symbol.GetUltimate()};
+
+  return ultimate.test(Symbol::Flag::OmpThreadprivate);
 }
 
 static bool IsSymbolPrivate(const Symbol &symbol) {

``````````

</details>


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


More information about the flang-commits mailing list