@@ -1364,6 +1364,7 @@ class ResolveNamesVisitor : public virtual ScopeHandler,
1364
1364
void CheckImport (const SourceName &, const SourceName &);
1365
1365
void HandleCall (Symbol::Flag, const parser::Call &);
1366
1366
void HandleProcedureName (Symbol::Flag, const parser::Name &);
1367
+ bool CheckImplicitNoneExternal (const SourceName &, const Symbol &);
1367
1368
bool SetProcFlag (const parser::Name &, Symbol &, Symbol::Flag);
1368
1369
void ResolveSpecificationParts (ProgramTree &);
1369
1370
void AddSubpNames (ProgramTree &);
@@ -5853,10 +5854,7 @@ void ResolveNamesVisitor::HandleProcedureName(
5853
5854
return ;
5854
5855
}
5855
5856
if (!symbol->attrs ().test (Attr::INTRINSIC)) {
5856
- if (isImplicitNoneExternal () && !symbol->attrs ().test (Attr::EXTERNAL)) {
5857
- Say (name,
5858
- " '%s' is an external procedure without the EXTERNAL"
5859
- " attribute in a scope with IMPLICIT NONE(EXTERNAL)" _err_en_US);
5857
+ if (!CheckImplicitNoneExternal (name.source , *symbol)) {
5860
5858
return ;
5861
5859
}
5862
5860
MakeExternal (*symbol);
@@ -5877,6 +5875,7 @@ void ResolveNamesVisitor::HandleProcedureName(
5877
5875
if (!SetProcFlag (name, *symbol, flag)) {
5878
5876
return ; // reported error
5879
5877
}
5878
+ CheckImplicitNoneExternal (name.source , *symbol);
5880
5879
if (IsProcedure (*symbol) || symbol->has <DerivedTypeDetails>() ||
5881
5880
symbol->has <ObjectEntityDetails>() ||
5882
5881
symbol->has <AssocEntityDetails>()) {
@@ -5895,6 +5894,18 @@ void ResolveNamesVisitor::HandleProcedureName(
5895
5894
}
5896
5895
}
5897
5896
5897
+ bool ResolveNamesVisitor::CheckImplicitNoneExternal (
5898
+ const SourceName &name, const Symbol &symbol) {
5899
+ if (isImplicitNoneExternal () && !symbol.attrs ().test (Attr::EXTERNAL) &&
5900
+ !symbol.attrs ().test (Attr::INTRINSIC) && !symbol.HasExplicitInterface ()) {
5901
+ Say (name,
5902
+ " '%s' is an external procedure without the EXTERNAL"
5903
+ " attribute in a scope with IMPLICIT NONE(EXTERNAL)" _err_en_US);
5904
+ return false ;
5905
+ }
5906
+ return true ;
5907
+ }
5908
+
5898
5909
// Variant of HandleProcedureName() for use while skimming the executable
5899
5910
// part of a subprogram to catch calls to dummy procedures that are part
5900
5911
// of the subprogram's interface, and to mark as procedures any symbols
0 commit comments