[flang-commits] [flang] fa4a304 - [flang] Cope with homonymous generic/specific in generic resolution

Peter Klausler via flang-commits flang-commits at lists.llvm.org
Mon Jul 31 14:39:32 PDT 2023


Author: Peter Klausler
Date: 2023-07-31T14:39:22-07:00
New Revision: fa4a304d514740fcf1f7b80f2441a7847231f09e

URL: https://github.com/llvm/llvm-project/commit/fa4a304d514740fcf1f7b80f2441a7847231f09e
DIFF: https://github.com/llvm/llvm-project/commit/fa4a304d514740fcf1f7b80f2441a7847231f09e.diff

LOG: [flang] Cope with homonymous generic/specific in generic resolution

When a generic interface X has a specific procedure Y that is also a specific
procedure of another generic with the same name (Y), ensure that
generic resolution of a call to X that resolves to Y points to the
symbol of the specific procedure Y, not the generic.

Differential Revision: https://reviews.llvm.org/D156341

Added: 
    

Modified: 
    flang/lib/Semantics/expression.cpp

Removed: 
    


################################################################################
diff  --git a/flang/lib/Semantics/expression.cpp b/flang/lib/Semantics/expression.cpp
index 0f07fe0b202c60..1bb76c64526661 100644
--- a/flang/lib/Semantics/expression.cpp
+++ b/flang/lib/Semantics/expression.cpp
@@ -2434,7 +2434,8 @@ std::pair<const Symbol *, bool> ExpressionAnalyzer::ResolveGeneric(
     }
   }
   if (const auto *details{ultimate.detailsIf<semantics::GenericDetails>()}) {
-    for (const Symbol &specific : details->specificProcs()) {
+    for (const Symbol &specific0 : details->specificProcs()) {
+      const Symbol &specific{BypassGeneric(specific0)};
       if (isSubroutine != !IsFunction(specific)) {
         continue;
       }


        


More information about the flang-commits mailing list