diff --git a/flang/lib/Semantics/check-declarations.cpp b/flang/lib/Semantics/check-declarations.cpp --- a/flang/lib/Semantics/check-declarations.cpp +++ b/flang/lib/Semantics/check-declarations.cpp @@ -1857,7 +1857,9 @@ static const std::string *DefinesBindCName(const Symbol &symbol) { const auto *subp{symbol.detailsIf()}; - if ((subp && !subp->isInterface()) || symbol.has()) { + if ((subp && !subp->isInterface() && + ClassifyProcedure(symbol) != ProcedureDefinitionClass::Internal) || + symbol.has()) { // Symbol defines data or entry point return symbol.GetBindName(); } else {