aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGary Dismukes <dismukes@adacore.com>2025-03-21 22:03:46 +0000
committerEric Botcazou <ebotcazou@adacore.com>2025-06-10 10:58:59 +0200
commit4aca5bc773ced42d006e07197e24462d0fa38a8f (patch)
tree9c034ef16508f34101cbdd7037168af926cc38db
parent8a4b72a2d99918d6bc315f2664a22457b9848ce7 (diff)
downloadgcc-4aca5bc773ced42d006e07197e24462d0fa38a8f.zip
gcc-4aca5bc773ced42d006e07197e24462d0fa38a8f.tar.gz
gcc-4aca5bc773ced42d006e07197e24462d0fa38a8f.tar.bz2
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.
-rw-r--r--gcc/ada/exp_aggr.adb2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb
index f4674f5..b6c1605 100644
--- a/gcc/ada/exp_aggr.adb
+++ b/gcc/ada/exp_aggr.adb
@@ -7010,7 +7010,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