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

Peter Klausler via flang-commits flang-commits at lists.llvm.org
Mon May 23 18:27:19 PDT 2022


Author: Peter Klausler
Date: 2022-05-23T18:22:56-07:00
New Revision: 0377322897985294681bc57932f903a888f7fe68

URL: https://github.com/llvm/llvm-project/commit/0377322897985294681bc57932f903a888f7fe68
DIFF: https://github.com/llvm/llvm-project/commit/0377322897985294681bc57932f903a888f7fe68.diff

LOG: [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

Added: 
    

Modified: 
    flang/lib/Semantics/check-declarations.cpp

Removed: 
    


################################################################################
diff  --git a/flang/lib/Semantics/check-declarations.cpp b/flang/lib/Semantics/check-declarations.cpp
index 6327208252059..72816b6d33c1e 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<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
     return symbol.GetBindName();
   } else {


        


More information about the flang-commits mailing list