[flang-commits] [flang] [flang] Prevent IR name clashes between BIND(C) and external procedures (PR #66777)

via flang-commits flang-commits at lists.llvm.org
Wed Sep 20 00:13:50 PDT 2023


================
@@ -2623,6 +2628,43 @@ void CheckHelper::CheckGlobalName(const Symbol &symbol) {
   }
 }
 
+void CheckHelper::CheckProcedureAssemblyName(const Symbol &symbol) {
+  if (!IsProcedure(symbol) || symbol != symbol.GetUltimate())
+    return;
+  const std::string *bindName{symbol.GetBindName()};
+  const bool hasExplicitBindingLabel{
+      symbol.GetIsExplicitBindName() && bindName};
+  if (hasExplicitBindingLabel || IsExternal(symbol)) {
----------------
jeanPerier wrote:

I added a test showing this is OK and a few more cases that should not elicit errors.

https://github.com/llvm/llvm-project/pull/66777


More information about the flang-commits mailing list