[flang-commits] [flang] [flang] Fix homonymous interface and procedure warning (PR #171696)

Leandro Lupori via flang-commits flang-commits at lists.llvm.org
Thu Jan 8 12:20:10 PST 2026


================
@@ -4535,9 +4535,24 @@ void InterfaceVisitor::CheckGenericProcedures(Symbol &generic) {
   ResolveSpecificsInGeneric(generic, true);
   auto &details{generic.get<GenericDetails>()};
   if (auto *proc{details.CheckSpecific()}) {
-    context().Warn(common::UsageWarning::HomonymousSpecific,
-        proc->name().begin() > generic.name().begin() ? proc->name()
-                                                      : generic.name(),
+    // Use the source location that is not in a module file for the warning,
----------------
luporl wrote:

`parser::AllCookedSources::Precedes` is being used now.

This made the warning in bug159554.f90 disappear, as the generic interface in it is considered to precede the function in the `iso_c_binding` module.

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


More information about the flang-commits mailing list