[Ada] Assert failure on E_Enumeration_Literal and front-end unnesting

gcc/ada/

	* exp_unst.adb (Note_Uplevel_Bound): Exclude
	E_Enumeration_Literal.
This commit is contained in:
Arnaud Charlet 2021-01-24 09:08:14 -05:00 committed by Pierre-Marie de Rodat
parent 369965ea43
commit 05b7561e37

View File

@ -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),