From 05b7561e370699e43513a8ba54e48a817c92281a Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Sun, 24 Jan 2021 09:08:14 -0500 Subject: [Ada] Assert failure on E_Enumeration_Literal and front-end unnesting gcc/ada/ * exp_unst.adb (Note_Uplevel_Bound): Exclude E_Enumeration_Literal. --- gcc/ada/exp_unst.adb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'gcc/ada') diff --git a/gcc/ada/exp_unst.adb b/gcc/ada/exp_unst.adb index 69506f3..dda8d86 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), -- cgit v1.1