[flang-commits] [flang] [Flang] Use specific symbol rather than generic symbol as procInterface to declare procedure pointer. (PR #80738)

Daniel Chen via flang-commits flang-commits at lists.llvm.org
Tue Feb 6 10:32:46 PST 2024


https://github.com/DanielCChen updated https://github.com/llvm/llvm-project/pull/80738

>From 93045fa47ad1818a1dbf8df7a485cdc0d976caf3 Mon Sep 17 00:00:00 2001
From: cdchen-ca <cdchen at ca.ibm.com>
Date: Mon, 5 Feb 2024 15:07:44 -0500
Subject: [PATCH] [Flang] Use specific symbol rather than generic symbol in
 procedureInterface to declare procedure pointer.

---
 flang/lib/Semantics/resolve-names.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/flang/lib/Semantics/resolve-names.cpp b/flang/lib/Semantics/resolve-names.cpp
index 6914f95837f67..36deab969456d 100644
--- a/flang/lib/Semantics/resolve-names.cpp
+++ b/flang/lib/Semantics/resolve-names.cpp
@@ -5648,7 +5648,9 @@ void DeclarationVisitor::Post(const parser::ProcDecl &x) {
   const auto &name{std::get<parser::Name>(x.t)};
   const Symbol *procInterface{nullptr};
   if (interfaceName_) {
-    procInterface = interfaceName_->symbol;
+    procInterface = interfaceName_->symbol->has<GenericDetails>()
+        ? interfaceName_->symbol->get<GenericDetails>().specific()
+        : interfaceName_->symbol;
   }
   auto attrs{HandleSaveName(name.source, GetAttrs())};
   DerivedTypeDetails *dtDetails{nullptr};



More information about the flang-commits mailing list