[Ada] Fix inconsistent iteration with First_Formal and Next_Entity
authorPiotr Trojanek <trojanek@adacore.com>
Thu, 7 Jan 2021 11:14:42 +0000 (12:14 +0100)
committerPierre-Marie de Rodat <derodat@adacore.com>
Tue, 4 May 2021 09:17:34 +0000 (05:17 -0400)
gcc/ada/

* sem_ch12.adb (Check_Abstract_Primitives): Match First_Formal
with Next_Formal.
* sem_ch6.adb (Is_Non_Overriding_Operation): Likewise.

gcc/ada/sem_ch12.adb
gcc/ada/sem_ch6.adb

index 4761015..f635f25 100644 (file)
@@ -13682,8 +13682,8 @@ package body Sem_Ch12 is
                                     exit;
                                  end if;
 
-                                 Next_Entity (Anc_Formal);
-                                 Next_Entity (Act_Formal);
+                                 Next_Formal (Anc_Formal);
+                                 Next_Formal (Act_Formal);
                               end loop;
 
                               --  If we traversed through all of the formals
index cd3fd11..a53540d 100644 (file)
@@ -10713,8 +10713,8 @@ package body Sem_Ch6 is
                            exit;
                         end if;
 
-                        Next_Entity (P_Formal);
-                        Next_Entity (N_Formal);
+                        Next_Formal (P_Formal);
+                        Next_Formal (N_Formal);
                      end loop;
 
                      --  Found a matching primitive operation belonging to the