Set_Is_Overloaded (Call_Name, False);
end if;
+ if Nkind (Decl) /= N_Subprogram_Declaration then
+ Rewrite (N,
+ Make_Subprogram_Declaration (Loc,
+ Specification => Specification (N)));
+ end if;
+
-- For simple renamings, subsequent calls can be expanded directly as
-- calls to the renamed entity. The body must be generated in any case
-- for calls that may appear elsewhere. This is not done in the case
-- body has not been built yet.
if Ekind (Old_S) in E_Function | E_Procedure
- and then Nkind (Decl) = N_Subprogram_Declaration
and then not Is_Generic_Instance (Old_S)
then
Set_Body_To_Inline (Decl, Old_S);
Statements => New_List (Call_Node)));
end if;
- if Nkind (Decl) /= N_Subprogram_Declaration then
- Rewrite (N,
- Make_Subprogram_Declaration (Loc,
- Specification => Specification (N)));
- end if;
-
-- Link the body to the entity whose declaration it completes. If
-- the body is analyzed when the renamed entity is frozen, it may
-- be necessary to restore the proper scope (see package Exp_Ch13).