[flang] Ignore BIND(C) binding name conflicts of inner procedures

The binding names of inner procedures with BIND(C) are not exposed
to the loader and should be ignored for potential conflict errors.

Differential Revision: https://reviews.llvm.org/D126141
This commit is contained in:
Peter Klausler 2022-05-11 14:32:59 -07:00
parent 9f33dd733f
commit 0377322897
1 changed files with 3 additions and 1 deletions

View File

@ -1857,7 +1857,9 @@ void CheckHelper::CheckGenericOps(const Scope &scope) {
static const std::string *DefinesBindCName(const Symbol &symbol) { static const std::string *DefinesBindCName(const Symbol &symbol) {
const auto *subp{symbol.detailsIf<SubprogramDetails>()}; const auto *subp{symbol.detailsIf<SubprogramDetails>()};
if ((subp && !subp->isInterface()) || symbol.has<ObjectEntityDetails>()) { if ((subp && !subp->isInterface() &&
ClassifyProcedure(symbol) != ProcedureDefinitionClass::Internal) ||
symbol.has<ObjectEntityDetails>()) {
// Symbol defines data or entry point // Symbol defines data or entry point
return symbol.GetBindName(); return symbol.GetBindName();
} else { } else {