summaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch12.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/sem_ch12.adb')
-rw-r--r--gcc/ada/sem_ch12.adb21
1 files changed, 11 insertions, 10 deletions
diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb
index 6d4e25d2d7f..8a531409b71 100644
--- a/gcc/ada/sem_ch12.adb
+++ b/gcc/ada/sem_ch12.adb
@@ -674,7 +674,7 @@ package body Sem_Ch12 is
-- generic is unit is validated, Set_Instance_Env completes Save_Env.
type Instance_Env is record
- Ada_83 : Boolean;
+ Ada_Version : Ada_Version_Type;
Instantiated_Parent : Assoc;
Exchanged_Views : Elist_Id;
Hidden_Entities : Elist_Id;
@@ -1469,9 +1469,9 @@ package body Sem_Ch12 is
if K = E_Generic_In_Parameter then
- -- Ada 0Y (AI-287): Limited aggregates allowed in generic formals
+ -- Ada 2005 (AI-287): Limited aggregates allowed in generic formals
- if not Extensions_Allowed and then Is_Limited_Type (T) then
+ if Ada_Version < Ada_05 and then Is_Limited_Type (T) then
Error_Msg_N
("generic formal of mode IN must not be of limited type", N);
Explain_Limited_Type (T, N);
@@ -2384,7 +2384,7 @@ package body Sem_Ch12 is
elsif Ekind (Gen_Unit) /= E_Generic_Package then
- -- Ada 0Y (AI-50217): Instance can not be used in limited with_clause
+ -- Ada 2005 (AI-50217): Cannot use instance in limited with_clause
if From_With_Type (Gen_Unit) then
Error_Msg_N
@@ -5674,7 +5674,7 @@ package body Sem_Ch12 is
Saved : Instance_Env;
begin
- Saved.Ada_83 := Ada_83;
+ Saved.Ada_Version := Ada_Version;
Saved.Instantiated_Parent := Current_Instantiated_Parent;
Saved.Exchanged_Views := Exchanged_Views;
Saved.Hidden_Entities := Hidden_Entities;
@@ -8072,7 +8072,7 @@ package body Sem_Ch12 is
elsif Is_Indefinite_Subtype (Act_T)
and then not Is_Indefinite_Subtype (A_Gen_T)
- and then Ada_95
+ and then Ada_Version >= Ada_95
then
Error_Msg_NE
("actual for & must be a definite subtype", Actual, Gen_T);
@@ -8128,7 +8128,7 @@ package body Sem_Ch12 is
elsif not Subtypes_Statically_Match
(Formal_Subt, Etype (Actual_Discr))
- and then Ada_95
+ and then Ada_Version >= Ada_95
then
Error_Msg_NE
("subtypes of actual discriminants must match formal",
@@ -8791,7 +8791,7 @@ package body Sem_Ch12 is
Saved : Instance_Env renames Instance_Envs.Table (Instance_Envs.Last);
begin
- Ada_83 := Saved.Ada_83;
+ Ada_Version := Saved.Ada_Version;
if No (Current_Instantiated_Parent.Act_Id) then
@@ -9751,12 +9751,13 @@ package body Sem_Ch12 is
begin
-- Regardless of the current mode, predefined units are analyzed in
- -- Ada95 mode, and Ada83 checks don't apply.
+ -- the most current Ada mode, and earlier version Ada checks do not
+ -- apply to predefined units.
if Is_Internal_File_Name
(Fname => Unit_File_Name (Get_Source_Unit (Gen_Unit)),
Renamings_Included => True) then
- Ada_83 := False;
+ Ada_Version := Ada_Version_Type'Last;
end if;
Current_Instantiated_Parent := (Gen_Unit, Act_Unit, Assoc_Null);