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

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Sat May 21 22:07:19 PDT 2022


klausler created this revision.
klausler added a reviewer: vdonaldson.
klausler added a project: Flang.
Herald added a subscriber: jdoerfert.
Herald added a project: All.
klausler requested review of this revision.

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


https://reviews.llvm.org/D126141

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


Index: flang/lib/Semantics/check-declarations.cpp
===================================================================
--- flang/lib/Semantics/check-declarations.cpp
+++ flang/lib/Semantics/check-declarations.cpp
@@ -1857,7 +1857,9 @@
 
 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 {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D126141.431198.patch
Type: text/x-patch
Size: 694 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20220522/df03cda5/attachment.bin>


More information about the flang-commits mailing list