@@ -547,10 +547,10 @@ package body Exp_Ch3 is
Act := First (Parameter_Specifications (Spec_Node));
while Present (Act) loop
+ exit when Act = Last (Parameter_Specifications (Spec_Node));
Append_To (Actuals,
Make_Identifier (Loc, Chars (Defining_Identifier (Act))));
Next (Act);
- exit when Act = Last (Parameter_Specifications (Spec_Node));
end loop;
Ptr :=
@@ -2686,9 +2686,10 @@ package body Exp_Ch6 is
Access_Subprogram_Wrapper (Etype (Name (N)));
Ptr : constant Node_Id := Prefix (Name (N));
Ptr_Type : constant Entity_Id := Etype (Ptr);
- Parms : constant List_Id := Parameter_Associations (N);
Typ : constant Entity_Id := Etype (N);
+
New_N : Node_Id;
+ Parms : List_Id := Parameter_Associations (N);
Ptr_Act : Node_Id;
begin
@@ -2711,6 +2712,12 @@ package body Exp_Ch6 is
Ptr_Act := Ptr;
end if;
+ -- Handle parameterless subprogram.
+
+ if No (Parms) then
+ Parms := New_List;
+ end if;
+
Append
(Make_Parameter_Association (Loc,
Selector_Name => Make_Identifier (Loc,