[Ada] AI12-0395: Allow aspect_specifications on formal parameters
authorArnaud Charlet <charlet@adacore.com>
Fri, 4 Sep 2020 08:08:58 +0000 (04:08 -0400)
committerPierre-Marie de Rodat <derodat@adacore.com>
Mon, 26 Oct 2020 08:58:53 +0000 (04:58 -0400)
gcc/ada/

* par-ch6.adb (P_Formal_Part): Ada 2020 supports scanning
aspects on formal parameters.
* doc/gnat_rm/implementation_defined_aspects.rst (Aspect
Unreferenced): Update documentation.
* gnat_rm.texi: Regenerate.

gcc/ada/doc/gnat_rm/implementation_defined_aspects.rst
gcc/ada/gnat_rm.texi
gcc/ada/par-ch6.adb

index de5efea..6f39de6 100644 (file)
@@ -566,7 +566,7 @@ Aspect Unreferenced
 
 This boolean aspect is equivalent to :ref:`pragma Unreferenced<Pragma-Unreferenced>`.
 
-When using the ``-gnatX`` switch, this aspect is also supported on formal
+When using the ``-gnat2020`` switch, this aspect is also supported on formal
 parameters, which is in particular the only form possible for expression
 functions.
 
index e1a5568..0ec8509 100644 (file)
@@ -9933,7 +9933,7 @@ This boolean aspect is equivalent to @ref{10b,,pragma Unmodified}.
 
 This boolean aspect is equivalent to @ref{10c,,pragma Unreferenced}.
 
-When using the @code{-gnatX} switch, this aspect is also supported on formal
+When using the @code{-gnat2020} switch, this aspect is also supported on formal
 parameters, which is in particular the only form possible for expression
 functions.
 
index 622a508..c8f4d87 100644 (file)
@@ -1631,8 +1631,8 @@ package body Ch6 is
          --  the time being.
 
          elsif Token = Tok_With then
-            if not Extensions_Allowed then
-               Error_Msg_SP ("aspect on formal parameter requires -gnatX");
+            if Ada_Version < Ada_2020 then
+               Error_Msg_SP ("aspect on formal parameter requires -gnat2020");
             end if;
 
             P_Aspect_Specifications (Specification_Node, False);