From: Piotr Trojanek Date: Mon, 23 Nov 2020 23:00:17 +0000 (+0100) Subject: [Ada] Refactor repeated code for fixed point attributes X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=57d5ceda2f8669bd36be135176e9e7ee416df7df;p=gcc.git [Ada] Refactor repeated code for fixed point attributes gcc/ada/ * sem_attr.adb (Analyze_Attribute): Consistently call Check_Fixed_Point_Type before checking the number of attribute expressions (like it is done for floating point types); reuse Check_Fixed_Point_Type_0. --- diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb index 58cb92fb54b..07719614edc 100644 --- a/gcc/ada/sem_attr.adb +++ b/gcc/ada/sem_attr.adb @@ -4112,8 +4112,8 @@ package body Sem_Attr is ----------------- when Attribute_Fixed_Value => - Check_E1; Check_Fixed_Point_Type; + Check_E1; Resolve (E1, Any_Integer); Set_Etype (N, P_Base_Type); @@ -6035,8 +6035,7 @@ package body Sem_Attr is when Attribute_Small_Denominator | Attribute_Small_Numerator => - Check_E0; - Check_Fixed_Point_Type; + Check_Fixed_Point_Type_0; Set_Etype (N, Universal_Integer); ------------------