diff --git a/flang/lib/Semantics/expression.cpp b/flang/lib/Semantics/expression.cpp --- a/flang/lib/Semantics/expression.cpp +++ b/flang/lib/Semantics/expression.cpp @@ -3000,6 +3000,8 @@ 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; diff --git a/flang/test/Semantics/resolve09.f90 b/flang/test/Semantics/resolve09.f90 --- a/flang/test/Semantics/resolve09.f90 +++ b/flang/test/Semantics/resolve09.f90 @@ -18,6 +18,7 @@ !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()