diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb --- a/gcc/ada/sem_ch12.adb +++ b/gcc/ada/sem_ch12.adb @@ -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 diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb --- a/gcc/ada/sem_ch6.adb +++ b/gcc/ada/sem_ch6.adb @@ -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