[Bug ada/15605] Illegal program not detected, RM 8.3(22), 8.5.4(6)

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Dec 30 11:09:03 GMT 2025


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

--- Comment #8 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Eric Botcazou <ebotcazou@gcc.gnu.org>:

https://gcc.gnu.org/g:564af5667f3e0277bffca6715c2863658af7cce5

commit r16-6440-g564af5667f3e0277bffca6715c2863658af7cce5
Author: Eric Botcazou <ebotcazou@gcc.gnu.org>
Date:   Tue Dec 30 11:44:54 2025 +0100

    Ada: Reject formal parameter as name of subprogram renaming

    This implements a minimal form of the old RM 8.5.4(6) rule, which forbids
    the use of (the name of) a formal parameter of the specification in the
    name of a renaming subprogram declaration; it turns out that implementing
    the full rule breaks existing code that works fine otherwise.

    gcc/ada/
            PR ada/15605
            * sem_ch8.adb (Analyze_Subprogram_Renaming): Give an error if the
            name is also that of a formal parameter of the specification.

    gcc/testsuite/
            * gnat.dg/specs/profile1.ads: New test.


More information about the Gcc-bugs mailing list