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

--- Comment #5 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:35e029530f256bb6302a3cae650d7eaef5514a36

commit r16-5047-g35e029530f256bb6302a3cae650d7eaef5514a36
Author: Eric Botcazou <[email protected]>
Date:   Wed Nov 5 21:15:35 2025 +0100

    Ada: Fix qualified name of discriminant incorrectly accepted in constraint

    The RM 3.8(12/3) subclause says that a discriminant mentioned in a
    constraint must appear alone as a direct name.  The last part is not
    consistently checked and, while the first part is, it generates a
    slightly different error message depending on the form of the input.

    This fixes the last part and changes the first to use a single message.

    gcc/ada/
            PR ada/35793
            * sem_res.adb (Check_Discriminant_Use): In a constraint context,
            check that the discriminant appears alone as a direct name in all
            cases and give a consistent error message when it does not.

    gcc/testsuite/
            * gnat.dg/specs/discr8.ads: New test.
  • [Bug ada/35793] qualified name ... cvs-commit at gcc dot gnu.org via Gcc-bugs

Reply via email to