]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Simplify code for checks within an initialization procedure
authorPiotr Trojanek <trojanek@adacore.com>
Mon, 27 Sep 2021 14:37:57 +0000 (16:37 +0200)
committerPierre-Marie de Rodat <derodat@adacore.com>
Mon, 11 Oct 2021 13:38:09 +0000 (13:38 +0000)
gcc/ada/

* sem_util.adb (Compile_Time_Constraint_Error): Simplify getting
the type of the first formal parameter.

gcc/ada/sem_util.adb

index 20e4395e4f3c440757605d8966896d2977ac741e..63d0217dc6fbe77b40c473fa7153a9dea8aed01e 100644 (file)
@@ -6590,9 +6590,7 @@ package body Sem_Util is
                if Inside_Init_Proc then
                   declare
                      Init_Proc_Type : constant Entity_Id :=
-                       Entity (Parameter_Type (First
-                                 (Parameter_Specifications
-                                    (Parent (Current_Scope_No_Loops)))));
+                       Etype (First_Formal (Current_Scope_No_Loops));
 
                      Conc_Typ : constant Entity_Id :=
                        (if Present (Init_Proc_Type)