[Ada] Process Truncation just like other floating point attributes
authorPiotr Trojanek <trojanek@adacore.com>
Mon, 23 Nov 2020 13:24:50 +0000 (14:24 +0100)
committerPierre-Marie de Rodat <derodat@adacore.com>
Mon, 14 Dec 2020 15:51:55 +0000 (10:51 -0500)
gcc/ada/

* sem_attr.adb (Analyze_Attribute): Merge similar code for
Truncation and other floating point attributes.

gcc/ada/sem_attr.adb

index 847d86359a786fa7b2677ad17d22b115d4fbe461..b243af6e1ffe9376b59009a0424cb9cdf79a1aa6 100644 (file)
@@ -3402,6 +3402,7 @@ package body Sem_Attr is
          | Attribute_Machine_Rounding
          | Attribute_Model
          | Attribute_Rounding
+         | Attribute_Truncation
          | Attribute_Unbiased_Rounding
       =>
          Check_Floating_Point_Type_1;
@@ -6409,10 +6410,7 @@ package body Sem_Attr is
       -- Truncation --
       ----------------
 
-      when Attribute_Truncation =>
-         Check_Floating_Point_Type_1;
-         Resolve (E1, P_Base_Type);
-         Set_Etype (N, P_Base_Type);
+      --  Shares processing with Ceiling attribute
 
       ----------------
       -- Type_Class --