[flang-commits] [flang] [flang][Semantics] Preserve ambiguous USE-error through whole-module USE (PR #229707)

via flang-commits flang-commits at lists.llvm.org
Wed Oct 7 15:59:18 PDT 2026


mleair wrote:

Thanks both for the review.

- Factored \`~Attrs{Attr::PUBLIC, Attr::PRIVATE, Attr::SAVE}\` into a named \`constexpr\` shared by both branches (\`a9b9569\`).
- Verified all three AI-assisted suggestions independently before acting on them:
  - The VOLATILE bookkeeping gap was real: without \`implicitAttrs()\`, the new branch produced a spurious \`VOLATILE attribute was already specified\` instead of leaving the case for proper ambiguity diagnosis. Fixed by mirroring the neighboring \`UseDetails\` branch (\`a9b9569\`); confirmed the example now compiles with zero diagnostics, matching the pre-fix baseline (no new rejection, no spurious one either).
  - The direct-reference ambiguity suggestion checked out exactly as described (\`Reference to 'x'/'y' is ambiguous\` in both bare and renamed form) — added as \`resolve133.f90\`.
  - The generic-interface suggestion checked out too (merged, renamed generic survives serialization and both specifics resolve correctly) — added as a GPK/GVM/GMIDDLE/GDOWN case in \`modfile89.f90\`, including actually calling both merged specifics rather than just compiling unused.

Full flang/test/Semantics suite is clean (1594 tests, 0 unexpected failures) with both commits applied.

Assisted-By: AI

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


More information about the flang-commits mailing list