[flang-commits] [PATCH] D131106: [flang] Don't check procedure pointer interface function result specification expressions

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Wed Aug 3 13:08:59 PDT 2022


klausler created this revision.
klausler added a reviewer: vdonaldson.
klausler added a project: Flang.
Herald added a subscriber: jdoerfert.
Herald added a project: All.
klausler requested review of this revision.

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.


https://reviews.llvm.org/D131106

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


Index: flang/lib/Semantics/check-declarations.cpp
===================================================================
--- flang/lib/Semantics/check-declarations.cpp
+++ flang/lib/Semantics/check-declarations.cpp
@@ -291,7 +291,11 @@
         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(


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D131106.449761.patch
Type: text/x-patch
Size: 699 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20220803/e4657362/attachment-0001.bin>


More information about the flang-commits mailing list