https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125240
--- Comment #7 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-16 branch has been updated by Eric Botcazou <[email protected]>: https://gcc.gnu.org/g:4c0a478aa889522e9b6be889fbcefe8ba649194f commit r16-8890-g4c0a478aa889522e9b6be889fbcefe8ba649194f 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.
