diff --git a/flang/lib/Semantics/expression.cpp b/flang/lib/Semantics/expression.cpp index 373c97ea9e05c..33a1b0c72c614 100644 --- a/flang/lib/Semantics/expression.cpp +++ b/flang/lib/Semantics/expression.cpp @@ -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; diff --git a/flang/test/Semantics/resolve09.f90 b/flang/test/Semantics/resolve09.f90 index 93b9781879d9c..acb9df4759711 100644 --- a/flang/test/Semantics/resolve09.f90 +++ b/flang/test/Semantics/resolve09.f90 @@ -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()