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

--- Comment #8 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:4ac884d077393b966294536a5b32ab6d6f9b3ca1

commit r15-11145-g4ac884d077393b966294536a5b32ab6d6f9b3ca1
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