[flang-commits] [flang] 525ff9b - [flang] Don't check procedure pointer interface function result specification expressions

Peter Klausler via flang-commits flang-commits at lists.llvm.org
Tue Aug 9 08:45:44 PDT 2022


Author: Peter Klausler
Date: 2022-08-09T08:45:32-07:00
New Revision: 525ff9bd206d7fcd3fee01f31985cd0c9990bfbb

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

LOG: [flang] Don't check procedure pointer interface function result specification expressions

When a procedure pointer references a function as its interface, don't
apply semantic checks to the specification expressions that appear in
the declaration of the function's result -- this can lead to bogus
error messages as those specification expressions are being examined
out of their proper context.

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

Added: 
    

Modified: 
    flang/lib/Semantics/check-declarations.cpp

Removed: 
    


################################################################################
diff  --git a/flang/lib/Semantics/check-declarations.cpp b/flang/lib/Semantics/check-declarations.cpp
index 3a506c9641fc..dca82554c7c9 100644
--- a/flang/lib/Semantics/check-declarations.cpp
+++ b/flang/lib/Semantics/check-declarations.cpp
@@ -291,7 +291,11 @@ void CheckHelper::Check(const Symbol &symbol) {
         canHaveAssumedParameter |= symbol.has<AssocEntityDetails>();
       }
     }
-    Check(*type, canHaveAssumedParameter);
+    if (IsProcedurePointer(symbol) && symbol.HasExplicitInterface()) {
+      // Don't check function result types here
+    } else {
+      Check(*type, canHaveAssumedParameter);
+    }
     if (InPure() && InFunction() && IsFunctionResult(symbol)) {
       if (derived && HasImpureFinal(*derived)) { // C1584
         messages_.Say(


        


More information about the flang-commits mailing list