]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Fix fallout of change to 'Wide_Wide_Value for enumeration types
authorEric Botcazou <ebotcazou@adacore.com>
Fri, 13 Sep 2024 19:09:31 +0000 (21:09 +0200)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Fri, 25 Oct 2024 09:08:59 +0000 (11:08 +0200)
commit18232cbcfd2c4f95bf51b4fa9fb65f545c2a0569
tree725e7a1102ae8c21068d4300faa828872fbb7d3e
parent20441f8a30189040df995b1f4800ceed75a8c23c
ada: Fix fallout of change to 'Wide_Wide_Value for enumeration types

The literals of enumeration types are always normalized, even though they
contain wide characters (but the normalization leaves these unchanged),
so a normalization routine that is aware of wide characters must be run
on the input string for 'Wide_Wide_Value.

gcc/ada/ChangeLog:

PR ada/115507
* rtsfind.ads (RE_Id): Add RE_Enum_[Wide_]Wide_String_To_String.
(RE_Unit_Table): Add entries for the new values.
* exp_attr.adb (Is_User_Defined_Enumeration_Type): New predicate.
(Expand_N_Attribute_Reference) <Attribute_Wide_Value>: Build a call
to RE_Enum_Wide_String_To_String for user-defined enumeration types.
<Attribute_Wide_Wide_Value>: Likewise with
RE_Enum_Wide_Wide_String_To_String.
* exp_imgv.adb (Expand_Value_Attribute): Adjust to above.
* libgnat/s-wchwts.ads (Enum_Wide_String_To_String): New function.
(Enum_Wide_Wide_String_To_String): Likewise.
* libgnat/s-wchwts.adb: Add clauses for System.Case_Util.
(Normalize_String): New local procedure.
(Enum_Wide_String_To_String): New function body.
(Enum_Wide_Wide_String_To_String): Likewise.
gcc/ada/exp_attr.adb
gcc/ada/exp_imgv.adb
gcc/ada/libgnat/s-wchwts.adb
gcc/ada/libgnat/s-wchwts.ads
gcc/ada/rtsfind.ads