https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123302

--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-15 branch has been updated by Eric Botcazou
<[email protected]>:

https://gcc.gnu.org/g:f3ab0ca58a87e1ad2a05c623ca5b650c4068f59e

commit r15-10636-gf3ab0ca58a87e1ad2a05c623ca5b650c4068f59e
Author: Eric Botcazou <[email protected]>
Date:   Fri Dec 26 14:52:32 2025 +0100

    Ada: Fix bogus error on aggregate in call with qualified type in instance

    This happens with a container aggregate in the testcase, although this can
    very likely happen with a record aggregate as well.  The trick used in the
    Save_Global_References procedure for aggregates loses the qualification of
    the type of the formal for which the aggregate is the actual.

    gcc/ada/
            PR ada/123302
            * sem_ch12.adb
(Save_Global_Reference.Save_References_In_Aggregate):
            Recurse on the scope of the type to find one that is visible, in
the
            case of an actual in a subprogram call with a local type.

    gcc/testsuite/
            * gnat.dg/aggr34.adb: New test.
            * gnat.dg/aggr34_pkg1.ads, gnat.dg/aggr34_pkg1.adb: New helper.
            * gnat.dg/aggr34_pkg2.ads, gnat.dg/aggr34_pkg2.adb: Likewise.
            * gnat.dg/aggr34_pkg3.ads: Likewise.

Reply via email to