void CheckImport(const SourceName &, const SourceName &);
void HandleCall(Symbol::Flag, const parser::Call &);
void HandleProcedureName(Symbol::Flag, const parser::Name &);
+ bool CheckImplicitNoneExternal(const SourceName &, const Symbol &);
bool SetProcFlag(const parser::Name &, Symbol &, Symbol::Flag);
void ResolveSpecificationParts(ProgramTree &);
void AddSubpNames(ProgramTree &);
return;
}
if (!symbol->attrs().test(Attr::INTRINSIC)) {
- if (isImplicitNoneExternal() && !symbol->attrs().test(Attr::EXTERNAL)) {
- Say(name,
- "'%s' is an external procedure without the EXTERNAL"
- " attribute in a scope with IMPLICIT NONE(EXTERNAL)"_err_en_US);
+ if (!CheckImplicitNoneExternal(name.source, *symbol)) {
return;
}
MakeExternal(*symbol);
if (!SetProcFlag(name, *symbol, flag)) {
return; // reported error
}
+ CheckImplicitNoneExternal(name.source, *symbol);
if (IsProcedure(*symbol) || symbol->has<DerivedTypeDetails>() ||
symbol->has<ObjectEntityDetails>() ||
symbol->has<AssocEntityDetails>()) {
}
}
+bool ResolveNamesVisitor::CheckImplicitNoneExternal(
+ const SourceName &name, const Symbol &symbol) {
+ if (isImplicitNoneExternal() && !symbol.attrs().test(Attr::EXTERNAL) &&
+ !symbol.attrs().test(Attr::INTRINSIC) && !symbol.HasExplicitInterface()) {
+ Say(name,
+ "'%s' is an external procedure without the EXTERNAL"
+ " attribute in a scope with IMPLICIT NONE(EXTERNAL)"_err_en_US);
+ return false;
+ }
+ return true;
+}
+
// Variant of HandleProcedureName() for use while skimming the executable
// part of a subprogram to catch calls to dummy procedures that are part
// of the subprogram's interface, and to mark as procedures any symbols