aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ada/sem_ch12.adb27
-rw-r--r--gcc/ada/sinput.ads2
-rw-r--r--gcc/ada/types.ads7
3 files changed, 14 insertions, 22 deletions
diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb
index 4ceddda..9919cda 100644
--- a/gcc/ada/sem_ch12.adb
+++ b/gcc/ada/sem_ch12.adb
@@ -1130,10 +1130,11 @@ package body Sem_Ch12 is
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
@@ -1145,9 +1146,8 @@ package body Sem_Ch12 is
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
@@ -1195,7 +1195,7 @@ package body Sem_Ch12 is
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
@@ -1314,14 +1314,8 @@ package body Sem_Ch12 is
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);
@@ -1592,7 +1586,7 @@ package body Sem_Ch12 is
Append (Decl, Assoc_List);
- if No (Found_Assoc) then
+ if No (Found_Assoc) then -- i.e. 'others'
Default :=
Make_Generic_Association (Loc,
Selector_Name =>
@@ -1686,7 +1680,6 @@ package body Sem_Ch12 is
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);
@@ -2311,7 +2304,7 @@ package body Sem_Ch12 is
-- 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);
diff --git a/gcc/ada/sinput.ads b/gcc/ada/sinput.ads
index b223147..1045acd 100644
--- a/gcc/ada/sinput.ads
+++ b/gcc/ada/sinput.ads
@@ -804,7 +804,7 @@ private
-- The following fields are for internal use only (i.e. only in the
-- body of Sinput or its children, with no direct access by clients).
- Sloc_Adjust : Source_Ptr;
+ Sloc_Adjust : Source_Ptr'Base; -- can be (very) negative
-- A value to be added to Sloc values for this file to reference the
-- corresponding lines table. This is zero for the non-instantiation
-- case, and set so that the addition references the ultimate template
diff --git a/gcc/ada/types.ads b/gcc/ada/types.ads
index 8a1d905..4fd75d4 100644
--- a/gcc/ada/types.ads
+++ b/gcc/ada/types.ads
@@ -145,9 +145,8 @@ package Types is
-- 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
@@ -265,7 +264,7 @@ package Types is
-- 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 --