From: Steve Baird <baird@adacore.com>
The argument to pragma Extensions_Allowed to enable all extensions is
no longer "All", but instead "All_Extensions".
gcc/ada/
* doc/gnat_rm/gnat_language_extensions.rst: Update documentation.
* doc/gnat_rm/implementation_defined_pragmas.rst: Update
documentation.
* errout.adb
(Error_Msg_GNAT_Extension): Update error message text.
* par-prag.adb: Update pragma parsing. This includes changing the
the name of the Check_Arg_Is_On_Or_Off formal parameter All_OK_Too
to All_Extensions_OK_Too.
* sem_prag.adb (Analyze_Pragma): In analyzing an
Extensions_Allowed pragma, replace uses of Name_All with
Name_All_Extensions; update a comment to reflect this.
* snames.ads-tmpl: Add Name_All_Extensions declaration.
* gnat_rm.texi: Regenerate.
Tested on x86_64-pc-linux-gnu, committed on master.
---
.../doc/gnat_rm/gnat_language_extensions.rst | 5 +++--
.../implementation_defined_pragmas.rst | 10 +++++-----
gcc/ada/errout.adb | 10 ++++++----
gcc/ada/gnat_rm.texi | 15 ++++++++-------
gcc/ada/par-prag.adb | 19 ++++++++++---------
gcc/ada/sem_prag.adb | 6 +++---
gcc/ada/snames.ads-tmpl | 1 +
7 files changed, 36 insertions(+), 30 deletions(-)
@@ -37,8 +37,9 @@ file, or in a ``.adc`` file corresponding to your project.
.. attention:: You can activate the extended set of extensions by using either
the ``-gnatX0`` command line flag, or the pragma ``Extensions_Allowed`` with
- ``All`` as an argument. However, it is not recommended you use this subset
- for serious projects, and is only means as a playground/technology preview.
+ ``All_Extensions`` as an argument. However, it is not recommended you use
+ this subset for serious projects; it is only meant as a technology preview
+ for use in playground experiments.
.. _Curated_Language_Extensions:
@@ -2208,19 +2208,19 @@ Syntax:
.. code-block:: ada
- pragma Extensions_Allowed (On | Off | All);
+ pragma Extensions_Allowed (On | Off | All_Extensions);
-This configuration pragma enables (via the "On" or "All" argument) or disables
-(via the "Off" argument) the implementation extension mode; the pragma takes
-precedence over the ``-gnatX`` and ``-gnatX0`` command switches.
+This configuration pragma enables (via the "On" or "All_Extensions" argument)
+or disables (via the "Off" argument) the implementation extension mode; the
+pragma takes precedence over the ``-gnatX`` and ``-gnatX0`` command switches.
If an argument of ``"On"`` is specified, the latest version of the Ada language
is implemented (currently Ada 2022) and, in addition, a curated set of GNAT
specific extensions are recognized. (See the list here
:ref:`here<Curated_Language_Extensions>`)
-An argument of ``"All"`` has the same effect except that some extra
+An argument of ``"All_Extensions"`` has the same effect except that some extra
experimental extensions are enabled (See the list here
:ref:`here<Experimental_Language_Extensions>`)
@@ -902,21 +902,23 @@ package body Errout is
if Is_Core_Extension then
Error_Msg
("\unit must be compiled with -gnatX '[or -gnatX0'] " &
- "or use pragma Extensions_Allowed (On) '[or All']", Loc);
+ "or use pragma Extensions_Allowed (On) '[or All_Extensions']",
+ Loc);
else
Error_Msg
("\unit must be compiled with -gnatX0 " &
- "or use pragma Extensions_Allowed (All)", Loc);
+ "or use pragma Extensions_Allowed (All_Extensions)", Loc);
end if;
else
Error_Msg_Sloc := Sloc (Ada_Version_Pragma);
Error_Msg ("\incompatible with Ada version set#", Loc);
if Is_Core_Extension then
Error_Msg
- ("\must use pragma Extensions_Allowed (On) '[or All']", Loc);
+ ("\must use pragma Extensions_Allowed (On)" &
+ " '[or All_Extensions']", Loc);
else
Error_Msg
- ("\must use pragma Extensions_Allowed (All)", Loc);
+ ("\must use pragma Extensions_Allowed (All_Extensions)", Loc);
end if;
end if;
end Error_Msg_GNAT_Extension;
@@ -3688,19 +3688,19 @@ GNAT User’s Guide.
Syntax:
@example
-pragma Extensions_Allowed (On | Off | All);
+pragma Extensions_Allowed (On | Off | All_Extensions);
@end example
-This configuration pragma enables (via the “On” or “All” argument) or disables
-(via the “Off” argument) the implementation extension mode; the pragma takes
-precedence over the @code{-gnatX} and @code{-gnatX0} command switches.
+This configuration pragma enables (via the “On” or “All_Extensions” argument)
+or disables (via the “Off” argument) the implementation extension mode; the
+pragma takes precedence over the @code{-gnatX} and @code{-gnatX0} command switches.
If an argument of @code{"On"} is specified, the latest version of the Ada language
is implemented (currently Ada 2022) and, in addition, a curated set of GNAT
specific extensions are recognized. (See the list here
@ref{69,,here})
-An argument of @code{"All"} has the same effect except that some extra
+An argument of @code{"All_Extensions"} has the same effect except that some extra
experimental extensions are enabled (See the list here
@ref{6a,,here})
@@ -28817,8 +28817,9 @@ activate the curated subset of extensions.
@quotation Attention
You can activate the extended set of extensions by using either
the @code{-gnatX0} command line flag, or the pragma @code{Extensions_Allowed} with
-@code{All} as an argument. However, it is not recommended you use this subset
-for serious projects, and is only means as a playground/technology preview.
+@code{All_Extensions} as an argument. However, it is not recommended you use
+this subset for serious projects; it is only meant as a technology preview
+for use in playground experiments.
@end quotation
@end cartouche
@@ -74,11 +74,11 @@ function Prag (Pragma_Node : Node_Id; Semi : Source_Ptr) return Node_Id is
-- is a string literal. If not give error and raise Error_Resync.
procedure Check_Arg_Is_On_Or_Off
- (Arg : Node_Id; All_OK_Too : Boolean := False);
+ (Arg : Node_Id; All_Extensions_OK_Too : Boolean := False);
-- Check the expression of the specified argument to make sure that it
-- is an identifier which is either ON or OFF, and if not, then issue
- -- an error message and raise Error_Resync. If All_OK_Too is True,
- -- then an ALL identifer is also acceptable.
+ -- an error message and raise Error_Resync. If All_Extensions_OK_Too is
+ -- True, then an ALL_EXTENSIONS identifer is also acceptable.
procedure Check_No_Identifier (Arg : Node_Id);
-- Checks that the given argument does not have an identifier. If
@@ -170,21 +170,22 @@ function Prag (Pragma_Node : Node_Id; Semi : Source_Ptr) return Node_Id is
----------------------------
procedure Check_Arg_Is_On_Or_Off
- (Arg : Node_Id; All_OK_Too : Boolean := False)
+ (Arg : Node_Id; All_Extensions_OK_Too : Boolean := False)
is
Argx : constant Node_Id := Expression (Arg);
Error : Boolean := Nkind (Expression (Arg)) /= N_Identifier;
begin
if not Error then
Error := Chars (Argx) not in Name_On | Name_Off
- and then not (All_OK_Too and Chars (Argx) = Name_All);
+ and then not (All_Extensions_OK_Too
+ and then Chars (Argx) = Name_All_Extensions);
end if;
if Error then
Error_Msg_Name_2 := Name_On;
Error_Msg_Name_3 := Name_Off;
- if All_OK_Too then
- Error_Msg_Name_4 := Name_All;
+ if All_Extensions_OK_Too then
+ Error_Msg_Name_4 := Name_All_Extensions;
Error_Msg_N ("argument for pragma% must be% or% or%", Argx);
else
Error_Msg_N ("argument for pragma% must be% or%", Argx);
@@ -433,11 +434,11 @@ begin
when Pragma_Extensions_Allowed =>
Check_Arg_Count (1);
Check_No_Identifier (Arg1);
- Check_Arg_Is_On_Or_Off (Arg1, All_OK_Too => True);
+ Check_Arg_Is_On_Or_Off (Arg1, All_Extensions_OK_Too => True);
if Chars (Expression (Arg1)) = Name_On then
Ada_Version := Ada_With_Core_Extensions;
- elsif Chars (Expression (Arg1)) = Name_All then
+ elsif Chars (Expression (Arg1)) = Name_All_Extensions then
Ada_Version := Ada_With_All_Extensions;
else
Ada_Version := Ada_Version_Explicit;
@@ -17422,17 +17422,17 @@ package body Sem_Prag is
-- Extensions_Allowed --
------------------------
- -- pragma Extensions_Allowed (ON | OFF | ALL);
+ -- pragma Extensions_Allowed (ON | OFF | ALL_EXTENSIONS);
when Pragma_Extensions_Allowed =>
GNAT_Pragma;
Check_Arg_Count (1);
Check_No_Identifiers;
- Check_Arg_Is_One_Of (Arg1, Name_On, Name_Off, Name_All);
+ Check_Arg_Is_One_Of (Arg1, Name_On, Name_Off, Name_All_Extensions);
if Chars (Get_Pragma_Arg (Arg1)) = Name_On then
Ada_Version := Ada_With_Core_Extensions;
- elsif Chars (Get_Pragma_Arg (Arg1)) = Name_All then
+ elsif Chars (Get_Pragma_Arg (Arg1)) = Name_All_Extensions then
Ada_Version := Ada_With_All_Extensions;
else
Ada_Version := Ada_Version_Explicit;
@@ -783,6 +783,7 @@ package Snames is
Name_Address_Type : constant Name_Id := N + $;
Name_Aggregate : constant Name_Id := N + $;
+ Name_All_Extensions : constant Name_Id := N + $;
Name_Allow : constant Name_Id := N + $;
Name_Amount : constant Name_Id := N + $;
Name_As_Is : constant Name_Id := N + $;