Extra formals must not be added to anonymous access to subprogram
types defined in the profile of imported C subprograms.
gcc/ada/ChangeLog:
* sem_ch6.adb (Create_Extra_Formals): Do not add extra formals to
anonymous access to subprogram types defined in the profile of
subprograms that have foreign convention.
then
Freeze_Extra_Formals (E);
return;
+
+ elsif Ekind (Ref_E) in E_Subprogram_Type
+ and then Is_Itype (Ref_E)
+ and then Nkind (Associated_Node_For_Itype (Ref_E)) in
+ N_Function_Specification
+ | N_Procedure_Specification
+ and then Has_Foreign_Convention
+ (Defining_Entity (Associated_Node_For_Itype (Ref_E)))
+ then
+ Freeze_Extra_Formals (E);
+ return;
end if;
-- If the subprogram is a predefined dispatching subprogram then don't