Saved_Formal : Node_Id;
Default_Formals : constant List_Id := New_List;
- -- If an Others_Choice is present, some of the formals may be defaulted.
- -- To simplify the treatment of visibility in an instance, we introduce
- -- individual defaults for each such formal. These defaults are
- -- appended to the list of associations and replace the Others_Choice.
+ -- If an N_Others_Choice is present, some of the formals may be
+ -- defaulted. To simplify the treatment of visibility in an instance,
+ -- we introduce individual defaults for each such formal. These
+ -- defaults are appended to the list of associations and replace the
+ -- N_Others_Choice.
Found_Assoc : Node_Id;
-- Association for the current formal being match. Empty if there are
Num_Actuals : Nat := 0;
Others_Present : Boolean := False;
- Others_Choice : Node_Id := Empty;
-- In Ada 2005, indicates partial parameterization of a formal
- -- package. As usual an other association must be last in the list.
+ -- package. As usual an 'others' association must be last in the list.
procedure Build_Subprogram_Wrappers;
-- Ada 2022: AI12-0272 introduces pre/postconditions for formal
procedure Process_Default (Formal : Node_Id);
-- Add a copy of the declaration of a generic formal to the list of
-- associations, and add an explicit box association for its entity
- -- if there is none yet, and the default comes from an Others_Choice.
+ -- if there is none yet, and the default comes from an N_Others_Choice.
function Renames_Standard_Subprogram (Subp : Entity_Id) return Boolean;
-- Determine whether Subp renames one of the subprograms defined in the
Error_Msg_N
("named association not allowed for overloaded formal",
Found_Assoc);
-
- else
- Error_Msg_N
- ("named association not allowed for overloaded formal",
- Others_Choice);
+ Abandon_Instantiation (Instantiation_Node);
end if;
-
- Abandon_Instantiation (Instantiation_Node);
end if;
Next (Temp_Formal);
Append (Decl, Assoc_List);
- if No (Found_Assoc) then
+ if No (Found_Assoc) then -- i.e. 'others'
Default :=
Make_Generic_Association (Loc,
Selector_Name =>
while Present (Actual) loop
if Nkind (Actual) = N_Others_Choice then
Others_Present := True;
- Others_Choice := Actual;
if Present (Next (Actual)) then
Error_Msg_N ("OTHERS must be last association", Actual);
-- If this is a formal package, normalize the parameter list by adding
-- explicit box associations for the formals that are covered by an
- -- Others_Choice.
+ -- N_Others_Choice.
Append_List (Default_Formals, Formals);
-- standard 32-bit integer as an index value, since we count on all index
-- values being the same size.
- type Text_Ptr is new Int;
- -- Type used for subscripts in text buffer
-
+ type Text_Ptr is new Int range -4 .. Int'Last;
+ -- -4 .. -1 are special; see constants below
type Text_Buffer is array (Text_Ptr range <>) of Character;
-- Text buffer used to hold source file or library information file
-- the location is in System, but we don't know exactly what line.
First_Source_Ptr : constant Source_Ptr := 0;
- -- Starting source pointer index value for first source program
+ -- Starting source pointer index value for first source file
-------------------------------------
-- Range Definitions for Tree Data --