===================================================================
@@ -326,14 +326,16 @@
case Prag_Id is
+ -- Ada version pragmas must be processed at parse time, because we want
+ -- to set the Ada version properly at parse time to recognize the
+ -- appropriate Ada version syntax. However, pragma Ada_2005 and higher
+ -- have an optional argument; it is only the zero argument form that
+ -- must be processed at parse time.
+
------------
-- Ada_83 --
------------
- -- This pragma must be processed at parse time, since we want to set
- -- the Ada version properly at parse time to recognize the appropriate
- -- Ada version syntax.
-
when Pragma_Ada_83 =>
if not Latest_Ada_Only then
Ada_Version := Ada_83;
@@ -345,10 +347,6 @@
-- Ada_95 --
------------
- -- This pragma must be processed at parse time, since we want to set
- -- the Ada version properly at parse time to recognize the appropriate
- -- Ada version syntax.
-
when Pragma_Ada_95 =>
if not Latest_Ada_Only then
Ada_Version := Ada_95;
@@ -360,11 +358,6 @@
-- Ada_05/Ada_2005 --
---------------------
- -- These pragmas must be processed at parse time, since we want to set
- -- the Ada version properly at parse time to recognize the appropriate
- -- Ada version syntax. However, it is only the zero argument form that
- -- must be processed at parse time.
-
when Pragma_Ada_05
| Pragma_Ada_2005
=>
@@ -378,11 +371,6 @@
-- Ada_12/Ada_2012 --
---------------------
- -- These pragmas must be processed at parse time, since we want to set
- -- the Ada version properly at parse time to recognize the appropriate
- -- Ada version syntax. However, it is only the zero argument form that
- -- must be processed at parse time.
-
when Pragma_Ada_12
| Pragma_Ada_2012
=>
@@ -392,6 +380,17 @@
Ada_Version_Pragma := Pragma_Node;
end if;
+ --------------
+ -- Ada_2020 --
+ --------------
+
+ when Pragma_Ada_2020 =>
+ if Arg_Count = 0 then
+ Ada_Version := Ada_2020;
+ Ada_Version_Explicit := Ada_2020;
+ Ada_Version_Pragma := Pragma_Node;
+ end if;
+
---------------------------
-- Compiler_Unit_Warning --
---------------------------
===================================================================
@@ -11835,7 +11835,7 @@
-- The one argument form is used for managing the transition from Ada
-- 2005 to Ada 2012 in the run-time library. If an entity is marked
- -- as Ada_201 only, then referencing the entity in any pre-Ada_2012
+ -- as Ada_2012 only, then referencing the entity in any pre-Ada_2012
-- mode will generate a warning. In addition, in any pre-Ada_2012
-- mode, a preference rule is established which does not choose
-- such an entity unless it is unambiguously specified. This avoids
@@ -11883,6 +11883,28 @@
end if;
end;
+ --------------
+ -- Ada_2020 --
+ --------------
+
+ -- pragma Ada_2020;
+
+ -- Note: this pragma also has some specific processing in Par.Prag
+ -- because we want to set the Ada 2020 version mode during parsing.
+
+ when Pragma_Ada_2020 =>
+ GNAT_Pragma;
+
+ Check_Arg_Count (0);
+
+ Check_Valid_Configuration_Pragma;
+
+ -- Now set appropriate Ada mode
+
+ Ada_Version := Ada_2020;
+ Ada_Version_Explicit := Ada_2020;
+ Ada_Version_Pragma := N;
+
----------------------
-- All_Calls_Remote --
----------------------
@@ -29419,6 +29441,7 @@
Pragma_Ada_2005 => -1,
Pragma_Ada_12 => -1,
Pragma_Ada_2012 => -1,
+ Pragma_Ada_2020 => -1,
Pragma_All_Calls_Remote => -1,
Pragma_Allow_Integer_Address => -1,
Pragma_Annotate => 93,
===================================================================
@@ -388,6 +388,7 @@
Name_Ada_2005 : constant Name_Id := N + $; -- GNAT
Name_Ada_12 : constant Name_Id := N + $; -- GNAT
Name_Ada_2012 : constant Name_Id := N + $; -- GNAT
+ Name_Ada_2020 : constant Name_Id := N + $; -- GNAT
Name_Allow_Integer_Address : constant Name_Id := N + $; -- GNAT
Name_Annotate : constant Name_Id := N + $; -- GNAT
Name_Assertion_Policy : constant Name_Id := N + $; -- Ada 05
@@ -1779,6 +1780,9 @@
Pragma_Ada_2005,
Pragma_Ada_12,
Pragma_Ada_2012,
+ Pragma_Ada_2020,
+ -- Note that there is no Pragma_Ada_20. Pragma_Ada_05/12 are for
+ -- compatibility reasons only; the full year names are preferred.
Pragma_Allow_Integer_Address,
Pragma_Annotate,
Pragma_Assertion_Policy,