Declaration checking catches the error of a COMMON block and a subprogram
definition having the same name, but misses the case of a COMMON block
and an a reference to an external subprogram with an implicit interface.
Fix. Fixes bug https://github.com/llvm/llvm-project/issues/63247.
Differential Revision: https://reviews.llvm.org/D153786
} else {
const std::string *bindC{symbol.GetBindName()};
if (symbol.has<CommonBlockDetails>() ||
- IsExternalProcedureDefinition(symbol)) {
+ IsExternalProcedureDefinition(symbol) ||
+ (symbol.owner().IsGlobal() && IsExternal(symbol))) {
return bindC ? *bindC : symbol.name().ToString();
} else if (bindC &&
(symbol.has<ObjectEntityDetails>() || IsModuleProcedure(symbol))) {
!PORTABILITY: Global name 'ext4' conflicts with a module
common /ext4/ x
end
+
+subroutine s
+ !ERROR: Two entities have the same global name 'foo'
+ common /foo/n
+ call foo
+end