https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126928
--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-16 branch has been updated by Eric Botcazou <[email protected]>: https://gcc.gnu.org/g:929cafe124d0020c66dea03d069374c9e4c5aec2 commit r16-9560-g929cafe124d0020c66dea03d069374c9e4c5aec2 Author: Eric Botcazou <[email protected]> Date: Wed Aug 19 15:19:41 2026 +0200 Ada: Fix assertion failure on nested formal packages with box notation The compiler is trying to instantiate a generic body for an instantiation present in a transient package that it has discarded. gcc/ada/ PR ada/126928 * sem_ch12.adb (In_Local_Package_Of_Formal_Package): New predicate. (Analyze_Package_Instantiation): Do not register the instantiation of the body if it is present in the local package of a formal one. (Need_Subprogram_Instance_Body): Likewise. gcc/testsuite/ * gnat.dg/specs/generic_inst10.ads: New test. * gnat.dg/specs/generic_inst10_g1.ads: New helper. * gnat.dg/specs/generic_inst10_g2.ads: Likewise. * gnat.dg/specs/generic_inst10_g3.ads: Likewise. * gnat.dg/specs/generic_inst10_pkg.ads: Likewise.
