aboutsummaryrefslogtreecommitdiff
path: root/flang/lib/Semantics/check-declarations.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'flang/lib/Semantics/check-declarations.cpp')
-rw-r--r--flang/lib/Semantics/check-declarations.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/flang/lib/Semantics/check-declarations.cpp b/flang/lib/Semantics/check-declarations.cpp
index 31e246c..549ee83 100644
--- a/flang/lib/Semantics/check-declarations.cpp
+++ b/flang/lib/Semantics/check-declarations.cpp
@@ -472,6 +472,10 @@ void CheckHelper::Check(const Symbol &symbol) {
messages_.Say(
"A function result may not also be a named constant"_err_en_US);
}
+ if (!IsProcedurePointer(symbol) && IsProcedure(symbol)) {
+ messages_.Say(
+ "A function result may not be a procedure unless it is a procedure pointer"_err_en_US);
+ }
}
if (IsAutomatic(symbol)) {
if (const Symbol * common{FindCommonBlockContaining(symbol)}) {
@@ -1781,7 +1785,7 @@ void CheckHelper::CheckExternal(const Symbol &symbol) {
if (auto previousChars{Characterize(previous)}) {
std::string whyNot;
if (!chars->IsCompatibleWith(*previousChars,
- /*ignoreImplicitVsExplicit=*/false, &whyNot)) {
+ /*ignoreImplicitVsExplicit=*/true, &whyNot)) {
if (auto *msg{Warn(common::UsageWarning::ExternalInterfaceMismatch,
"The external interface '%s' is not compatible with an earlier definition (%s)"_warn_en_US,
symbol.name(), whyNot)}) {