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

Peter Klausler via flang-commits flang-commits at lists.llvm.org
Wed Jan 7 10:20:28 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,
----------------
klausler wrote:

There's already infrastructure in the compiler that produces reproducible results for name comparisons, and it should have been used here.  See `parser::AllCookedSources::Precedes(CharBlock x, CharBlock y)`, or its client `semantics::SymbolSourcePositionCompare::operator()`.

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


More information about the flang-commits mailing list