From: Arnaud Charlet Date: Fri, 4 Sep 2020 08:08:58 +0000 (-0400) Subject: [Ada] AI12-0395: Allow aspect_specifications on formal parameters X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e3710c6509fc8a914f94b5cbf50531e773229c9a;p=gcc.git [Ada] AI12-0395: Allow aspect_specifications on formal parameters 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. --- diff --git a/gcc/ada/doc/gnat_rm/implementation_defined_aspects.rst b/gcc/ada/doc/gnat_rm/implementation_defined_aspects.rst index de5efea5385..6f39de69df0 100644 --- a/gcc/ada/doc/gnat_rm/implementation_defined_aspects.rst +++ b/gcc/ada/doc/gnat_rm/implementation_defined_aspects.rst @@ -566,7 +566,7 @@ Aspect Unreferenced This boolean aspect is equivalent to :ref:`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. diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi index e1a5568549f..0ec85094c4d 100644 --- a/gcc/ada/gnat_rm.texi +++ b/gcc/ada/gnat_rm.texi @@ -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. diff --git a/gcc/ada/par-ch6.adb b/gcc/ada/par-ch6.adb index 622a508b6cd..c8f4d87f045 100644 --- a/gcc/ada/par-ch6.adb +++ b/gcc/ada/par-ch6.adb @@ -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);