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

--- Comment #6 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:78cfbf9df7a3aa5d78dd1ac95222691f7e448e34

commit r17-431-g78cfbf9df7a3aa5d78dd1ac95222691f7e448e34
Author: Eric Botcazou <[email protected]>
Date:   Sun May 10 12:51:44 2026 +0200

    Ada: Fix Image for derived enumeration type with representation clause

    The problem is that Expand_Image_Attribute incorrectly fetches the root
type
    for enumeration types, thus bypassing a clause present on the derived type.

    The fix is to change the two fields Lit_Indexes and Lit_Strings defined for
    enumeration types and subtypes to be formally present on root types only,
as
    well as to make Expand_Image_Attribute stick to base types.

    gcc/ada/
            PR ada/125240
            * gen_il-gen-gen_entities.adb (Enumeration_Kind): Make
            Lit_Indexes and Lit_Strings be defined for root types only.
            * einfo.ads (Lit_Hash): Adjust description.
            (Lit_Indexes): Likewise.
            (Lit_Strings): Likewise.
            (E_Enumeration_Type): Likewise.
            * exp_imgv.adb (Expand_Image_Attribute): Do not fetch the root type
            for enumeration types, except for character types, and adjust.

    gcc/testsuite/
            * gnat.dg/enum6.adb: New test.

Reply via email to