[flang-commits] [flang] [Flang][OpenMP] Fix interop-var handling and diagnostics (#203959) (PR #211693)

Sairudra More via flang-commits flang-commits at lists.llvm.org
Fri Jul 24 02:02:52 PDT 2026


================
@@ -5978,6 +5978,48 @@ void OmpStructureChecker::Enter(const parser::OpenMPInteropConstruct &x) {
   bool hasInitClause{false};
   int targetCount{0}, targetSyncCount{0};
   std::set<const Symbol *> objectSymbolList;
----------------
Saieiei wrote:

Now that array elements and derived-type components are accepted as interop variables, tracking uniqueness only by the underlying symbol seems too coarse. For example, `INIT(TARGET: arr(1)) USE(arr(2))` uses two distinct scalar variables, but both designators resolve to the symbol `arr` and will be treated as a duplicate.

Could this compare the complete designators instead? A positive test with distinct elements/components and a negative test repeating the same designator would also help.

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


More information about the flang-commits mailing list