https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128044
--- Comment #7 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Eric Botcazou <[email protected]>: https://gcc.gnu.org/g:5b40bde87b479ae1c3968a1fb019ee4029d397d7 commit r17-5492-g5b40bde87b479ae1c3968a1fb019ee4029d397d7 Author: Eric Botcazou <[email protected]> Date: Thu Oct 22 19:12:57 2026 +0200 Ada: Fix fully qualified name wrongly resolved in instance of generic child This is a regression present on the mainline and 16 branch, introduced by the recent removal of an old kludge from Sem_Ch8.Premature_Usage that was salvaging the incorrect resolution of a fully qualified name in the instance of a generic child unit that is a homonym of one of its parents. It turns out that the incorrect resolution comes from another old kludge present in Save_Global_References that short-circuits the normal resolution implemented in Find_Expanded_Name. gcc/ada/ PR ada/128044 * sem_ch12.adb (Save_Global_References.Reset_Entity): Remove old kludge short-circuiting the resolution of expanded names. gcc/testsuite/ * gnat.dg/specs/generic_inst11.ads: New test. * gnat.dg/specs/generic_inst11_pkg.ads: New helper package. * gnat.dg/specs/generic_inst11_pkg-g1.ads: Likewise. * gnat.dg/specs/generic_inst11_pkg-g1-parser.ads: Likewise. * gnat.dg/specs/generic_inst11_pkg-g1-parser-g2.ads: Likewise. * gnat.dg/specs/generic_inst11_pkg-g1-parser-g2-parser.ads: Likewise
