[flang] Emit error about missing interface when needed
authorpeter klausler <pklausler@nvidia.com>
Thu, 3 Jun 2021 00:25:29 +0000 (17:25 -0700)
committerpeter klausler <pklausler@nvidia.com>
Thu, 3 Jun 2021 22:19:54 +0000 (15:19 -0700)
When a procedure pointer with no interface is called by a
function reference, complain about the lack.

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

flang/lib/Semantics/expression.cpp
flang/test/Semantics/resolve09.f90

index 373c97e..33a1b0c 100644 (file)
@@ -3000,6 +3000,8 @@ MaybeExpr ExpressionAnalyzer::MakeFunctionRef(parser::CharBlock callSite,
             DEREF(result.GetTypeAndShape()).type(),
             ProcedureRef{std::move(proc), std::move(arguments)});
       }
+    } else {
+      Say("Function result characteristics are not known"_err_en_US);
     }
   }
   return std::nullopt;
index 93b9781..acb9df4 100644 (file)
@@ -18,6 +18,7 @@ subroutine s
   !ERROR: Cannot call function 'f' like a subroutine
   call f
   !ERROR: Cannot call subroutine 's' like a function
+  !ERROR: Function result characteristics are not known
   i = s()
 contains
   function f()