[Ada] Fix evaluation of Enum_Rep applied to imported constant

gcc/ada/

	* sem_attr.adb (Eval_Attribute): Check if constant has an
	initialization expression.
This commit is contained in:
Piotr Trojanek 2020-05-07 14:08:07 +02:00 committed by Pierre-Marie de Rodat
parent 8f892a98cc
commit f0e6256fd3

View File

@ -7834,6 +7834,8 @@ package body Sem_Attr is
(Ekind (Entity (Enum_Expr)) = E_Constant
and then Nkind (Parent (Entity (Enum_Expr))) =
N_Object_Declaration
and then Present
(Expression (Parent (Entity (P))))
and then Compile_Time_Known_Value
(Expression (Parent (Entity (P))))))
then