[Ada] Remove obsolete code in Eval_Attribute
authorEric Botcazou <ebotcazou@adacore.com>
Tue, 5 May 2020 14:09:33 +0000 (16:09 +0200)
committerPierre-Marie de Rodat <derodat@adacore.com>
Mon, 6 Jul 2020 11:34:57 +0000 (07:34 -0400)
gcc/ada/

* sem_attr.adb (Eval_Attribute): Do not apply range checks in
the case of 'Pos applied to an integer type here.

gcc/ada/sem_attr.adb

index 5041a12..81130b5 100644 (file)
@@ -8354,16 +8354,6 @@ package body Sem_Attr is
             if not Compile_Time_Known_Value (E)
               or else not Is_Scalar_Type (Etype (E))
             then
-               --  An odd special case, if this is a Pos attribute, this
-               --  is where we need to apply a range check since it does
-               --  not get done anywhere else.
-
-               if Id = Attribute_Pos then
-                  if Is_Integer_Type (Etype (E)) then
-                     Apply_Range_Check (E, Etype (N));
-                  end if;
-               end if;
-
                Check_Expressions;
                return;