diff --git a/flang/lib/Evaluate/characteristics.cpp b/flang/lib/Evaluate/characteristics.cpp --- a/flang/lib/Evaluate/characteristics.cpp +++ b/flang/lib/Evaluate/characteristics.cpp @@ -485,6 +485,11 @@ [&](const semantics::UseDetails &use) { return CharacterizeProcedure(use.symbol(), context, seenProcs); }, + [](const semantics::UseErrorDetails &) { + // Ambiguous use-association will be handled later during symbol + // checks, ignore UseErrorDetails here without actual symbol usage. + return std::optional{}; + }, [&](const semantics::HostAssocDetails &assoc) { return CharacterizeProcedure(assoc.symbol(), context, seenProcs); }, diff --git a/flang/test/Semantics/resolve112.f90 b/flang/test/Semantics/resolve112.f90 new file mode 100644 --- /dev/null +++ b/flang/test/Semantics/resolve112.f90 @@ -0,0 +1,20 @@ +! RUN: %flang_fc1 %s +! No errors expected +module a + contains + function foo() + foo = 42 + end function foo +end module a + +module b + contains + function foo() + foo = 42 + end function foo +end module b + +program c + use a + use b +end program c