From: Gary Dismukes Date: Fri, 21 Mar 2025 22:03:46 +0000 (+0000) Subject: ada: Storage_Error on Ordered_Maps container aggregate with enumeration Key_Type X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f2b992095a7310cbf83b15c218314dc46c675188;p=thirdparty%2Fgcc.git ada: Storage_Error on Ordered_Maps container aggregate with enumeration Key_Type The compiler fails with a Storage_Error when compiling a container aggregate for a Map type coming from an instantiation of Ada.Containers.Ordered_Maps that specifies an enumeration type for the Key_Type formal. gcc/ada/ChangeLog: * exp_aggr.adb (Build_Container_Aggr_Code.To_Int): Apply Enumeration_Pos to Entity (Expr) rather than Expr. --- diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb index 8db15fa6a11..8aad7217935 100644 --- a/gcc/ada/exp_aggr.adb +++ b/gcc/ada/exp_aggr.adb @@ -7017,7 +7017,7 @@ package body Exp_Aggr is begin return UI_To_Int ((if Nkind (Expr) = N_Integer_Literal then Intval (Expr) - else Enumeration_Pos (Expr))); + else Enumeration_Pos (Entity (Expr)))); end To_Int; -- Local variables