]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Set ekind of loop parameters earlier
authorRonan Desplanques <desplanques@adacore.com>
Wed, 16 Apr 2025 10:33:11 +0000 (12:33 +0200)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Tue, 1 Jul 2025 08:29:39 +0000 (10:29 +0200)
gcc/ada/ChangeLog:

* sem_ch5.adb (Analyze_Loop_Parameter_Specification): Set ekind
earlier.

gcc/ada/sem_ch5.adb

index 12b04fd8e880bd448c5c8f11887648790eb71bfe..caba1e215b1543606a694a12020e2a8d65ab177b 100644 (file)
@@ -3149,6 +3149,7 @@ package body Sem_Ch5 is
    --  Start of processing for Analyze_Loop_Parameter_Specification
 
    begin
+      Mutate_Ekind (Id, E_Loop_Parameter);
       Enter_Name (Id);
 
       --  We always consider the loop variable to be referenced, since the loop
@@ -3254,7 +3255,6 @@ package body Sem_Ch5 is
                --  subsequent analysis of the condition in a quantified
                --  expression.
 
-               Mutate_Ekind (Id, E_Loop_Parameter);
                return;
             end;
 
@@ -3317,7 +3317,6 @@ package body Sem_Ch5 is
          Make_Index (DS, N);
       end if;
 
-      Mutate_Ekind (Id, E_Loop_Parameter);
       Set_Etype (Id, Etype (DS));
 
       Set_Is_Not_Self_Hidden (Id);