Analysis of attribute Truncation was first calling Resolve and then
Set_Etype, while all the similar attributes had these calls in the
reverse order. This inconsistency was present since the support for
Truncation was added, but it had no semantics implications.

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

        * sem_attr.adb (Analyze_Attribute): Merge similar code for
        Truncation and other floating point attributes.
diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb
--- a/gcc/ada/sem_attr.adb
+++ b/gcc/ada/sem_attr.adb
@@ -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 --


Reply via email to