From 0377322897985294681bc57932f903a888f7fe68 Mon Sep 17 00:00:00 2001 From: Peter Klausler Date: Wed, 11 May 2022 14:32:59 -0700 Subject: [PATCH] [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 --- flang/lib/Semantics/check-declarations.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/flang/lib/Semantics/check-declarations.cpp b/flang/lib/Semantics/check-declarations.cpp index 632720825205..72816b6d33c1 100644 --- a/flang/lib/Semantics/check-declarations.cpp +++ b/flang/lib/Semantics/check-declarations.cpp @@ -1857,7 +1857,9 @@ void CheckHelper::CheckGenericOps(const Scope &scope) { 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 {