When detecting controlling formals we are only interested in formal
parameters and not in other entities.
gcc/ada/
* sem_ch6.adb (Controlling_Formal): Iterate with First/Next_Formal
and not with First/Next_Entity.
E : Entity_Id;
begin
- E := First_Entity (Prim);
+ E := First_Formal (Prim);
while Present (E) loop
- if Is_Formal (E) and then Is_Controlling_Formal (E) then
+ if Is_Controlling_Formal (E) then
return E;
end if;
- Next_Entity (E);
+ Next_Formal (E);
end loop;
return Empty;