From: Arnaud Charlet Date: Sun, 24 Jan 2021 14:08:14 +0000 (-0500) Subject: [Ada] Assert failure on E_Enumeration_Literal and front-end unnesting X-Git-Tag: basepoints/gcc-13~7758 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=05b7561e370699e43513a8ba54e48a817c92281a;p=thirdparty%2Fgcc.git [Ada] Assert failure on E_Enumeration_Literal and front-end unnesting gcc/ada/ * exp_unst.adb (Note_Uplevel_Bound): Exclude E_Enumeration_Literal. --- diff --git a/gcc/ada/exp_unst.adb b/gcc/ada/exp_unst.adb index 69506f315145..dda8d868004b 100644 --- a/gcc/ada/exp_unst.adb +++ b/gcc/ada/exp_unst.adb @@ -527,14 +527,17 @@ package body Exp_Unst is -- Entity name case. Make sure that the entity is declared -- in a subprogram. This may not be the case for a type in a -- loop appearing in a precondition. - -- Exclude explicitly discriminants (that can appear - -- in bounds of discriminated components). + -- Exclude explicitly discriminants (that can appear + -- in bounds of discriminated components) and enumeration + -- literals. if Is_Entity_Name (N) then if Present (Entity (N)) and then not Is_Type (Entity (N)) and then Present (Enclosing_Subprogram (Entity (N))) - and then Ekind (Entity (N)) /= E_Discriminant + and then + Ekind (Entity (N)) + not in E_Discriminant | E_Enumeration_Literal then Note_Uplevel_Ref (E => Entity (N),