From f0e6256fd399418047772ebc72d2025938f7ccd8 Mon Sep 17 00:00:00 2001 From: Piotr Trojanek Date: Thu, 7 May 2020 14:08:07 +0200 Subject: [PATCH] [Ada] Fix evaluation of Enum_Rep applied to imported constant gcc/ada/ * sem_attr.adb (Eval_Attribute): Check if constant has an initialization expression. --- gcc/ada/sem_attr.adb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb index 4f112065abe..5e61810fbf9 100644 --- a/gcc/ada/sem_attr.adb +++ b/gcc/ada/sem_attr.adb @@ -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 -- 2.30.2