Index: flang/lib/Semantics/resolve-names.cpp =================================================================== --- flang/lib/Semantics/resolve-names.cpp +++ flang/lib/Semantics/resolve-names.cpp @@ -2423,6 +2423,8 @@ symbol.set_details(ObjectEntityDetails{std::move(*details)}); } else if (auto *useDetails{symbol.detailsIf()}) { return useDetails->symbol().has(); + } else if (auto *hostDetails{symbol.detailsIf()}) { + return hostDetails->symbol().has(); } else { return false; } @@ -2441,6 +2443,10 @@ CHECK(!symbol.test(Symbol::Flag::Subroutine)); symbol.set(Symbol::Flag::Function); } + } else if (auto *useDetails{symbol.detailsIf()}) { + return useDetails->symbol().has(); + } else if (auto *hostDetails{symbol.detailsIf()}) { + return hostDetails->symbol().has(); } else { return false; }