]> git.ipfire.org Git - thirdparty/gcc.git/commit
Ada: Fix instantiation failure with qualified name of child generic unit
authorEric Botcazou <ebotcazou@adacore.com>
Wed, 29 Oct 2025 23:06:00 +0000 (00:06 +0100)
committerEric Botcazou <ebotcazou@adacore.com>
Thu, 30 Oct 2025 00:38:28 +0000 (01:38 +0100)
commit28a10da664ee496b5c7f774b173100c8a22cbef3
treef46a28bcfd63b822d10082bcb080c7fbac29e663
parent1bb016ee11d79a96dd62f0fc13fd8c87407f242a
Ada: Fix instantiation failure with qualified name of child generic unit

This is again an issue with multiple levels of nested instances, and it
arises because the qualified name of the problematic child generic unit
is used (this works fine with the direct name), exposing the rather
questionable processing implemented for instances in Find_Expanded_Name.

The patch replaces this processing with the straightforward decoding of
the renaming scheme used in Sem_Ch12.

gcc/ada/
PR ada/16214
* sem_ch8.adb (Find_Expanded_Name): Consolidate and streamline the
processing required for references to instances within themselves.

gcc/testsuite/
* gnat.dg/specs/generic_inst6.ads: New test.
* gnat.dg/specs/generic_inst6_pkg1-child.ads: New helper.
* gnat.dg/specs/generic_inst6_pkg1-child-grand1.ads: Likewise.
* gnat.dg/specs/generic_inst6_pkg1-child-grand2.ads: Likewise.
* gnat.dg/specs/generic_inst6_pkg1.ads: Likewise.
* gnat.dg/specs/generic_inst6_pkg2.ads: Likewise.
* gnat.dg/specs/generic_inst6_pkg3.ads: Likewise.
gcc/ada/sem_ch8.adb
gcc/testsuite/gnat.dg/specs/generic_inst6.ads [new file with mode: 0644]
gcc/testsuite/gnat.dg/specs/generic_inst6_pkg1-child-grand1.ads [new file with mode: 0644]
gcc/testsuite/gnat.dg/specs/generic_inst6_pkg1-child-grand2.ads [new file with mode: 0644]
gcc/testsuite/gnat.dg/specs/generic_inst6_pkg1-child.ads [new file with mode: 0644]
gcc/testsuite/gnat.dg/specs/generic_inst6_pkg1.ads [new file with mode: 0644]
gcc/testsuite/gnat.dg/specs/generic_inst6_pkg2.ads [new file with mode: 0644]
gcc/testsuite/gnat.dg/specs/generic_inst6_pkg3.ads [new file with mode: 0644]