Index: flang/lib/Semantics/expression.cpp =================================================================== --- flang/lib/Semantics/expression.cpp +++ flang/lib/Semantics/expression.cpp @@ -2934,6 +2934,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; Index: flang/test/Semantics/resolve09.f90 =================================================================== --- flang/test/Semantics/resolve09.f90 +++ 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()