[Ada] Reuse Is_Named_Number where possible
authorPiotr Trojanek <trojanek@adacore.com>
Wed, 14 Oct 2020 22:55:16 +0000 (00:55 +0200)
committerPierre-Marie de Rodat <derodat@adacore.com>
Wed, 25 Nov 2020 13:22:39 +0000 (08:22 -0500)
gcc/ada/

* sem_ch13.adb (Check_Expr_Constants): Simplify with
Is_Named_Number.
* sem_prag.adb (Process_Convention): Likewise.

gcc/ada/sem_ch13.adb
gcc/ada/sem_prag.adb

index 45e9d7517955e9289f872eb1190b7455eab74bf6..b605b4d9a456d97c15cdf05da98ce479f9639213 100644 (file)
@@ -11120,9 +11120,7 @@ package body Sem_Ch13 is
 
                --  Otherwise look at the identifier and see if it is OK
 
-               if Ekind (Ent) in E_Named_Integer | E_Named_Real
-                 or else Is_Type (Ent)
-               then
+               if Is_Named_Number (Ent) or else Is_Type (Ent) then
                   return;
 
                elsif Ekind (Ent) in E_Constant | E_In_Parameter then
index eda8898bdb3c3905f549c095b85e4579919f6ae2..87497e599d8d3354c17d2b23306d068b600698e0 100644 (file)
@@ -8119,7 +8119,7 @@ package body Sem_Prag is
 
          --  Check that we are not applying this to a named constant
 
-         if Ekind (E) in E_Named_Integer | E_Named_Real then
+         if Is_Named_Number (E) then
             Error_Msg_Name_1 := Pname;
             Error_Msg_N
               ("cannot apply pragma% to named constant!",