diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2022-05-23 09:48:49 +0200 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2022-07-04 07:45:50 +0000 |
commit | ad7ed87a43655162cbd5765445681870aa99a3a8 (patch) | |
tree | 97af5b140e0610c8f20cb944573ed8a0efb286ea | |
parent | d74d98784a9d0101aad8095d692193a74a2f62f6 (diff) | |
download | gcc-ad7ed87a43655162cbd5765445681870aa99a3a8.zip gcc-ad7ed87a43655162cbd5765445681870aa99a3a8.tar.gz gcc-ad7ed87a43655162cbd5765445681870aa99a3a8.tar.bz2 |
[Ada] Adjust description of Pure_Function pragma
The current wording can be read as implying that the result of a call
to a pure function does not depend on the context, which is incorrect.
The pragma only guarantees the absence of side effects of such a call.
gcc/ada/
* doc/gnat_rm/implementation_defined_pragmas.rst (Pure_Function):
Fix ambiguous wording about context dependence.
* gnat_rm.texi: Regenerate.
-rw-r--r-- | gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst | 6 | ||||
-rw-r--r-- | gcc/ada/gnat_rm.texi | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst b/gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst index af85600..4318a34 100644 --- a/gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst +++ b/gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst @@ -5504,9 +5504,9 @@ overloaded declaration exists, in which case the pragma applies to all entities). It specifies that the function ``Entity`` is to be considered pure for the purposes of code generation. This means that the compiler can assume that there are no side effects, and -in particular that two calls with identical arguments produce the -same result. It also means that the function can be used in an -address clause. +in particular that two identical calls produce the same result in +the same context. It also means that the function can be used in +an address clause. Note that, quite deliberately, there are no static checks to try to ensure that this promise is met, so ``Pure_Function`` can be used diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi index a7077e0..13cff21 100644 --- a/gcc/ada/gnat_rm.texi +++ b/gcc/ada/gnat_rm.texi @@ -21,7 +21,7 @@ @copying @quotation -GNAT Reference Manual , May 24, 2022 +GNAT Reference Manual , Jun 24, 2022 AdaCore @@ -7088,9 +7088,9 @@ overloaded declaration exists, in which case the pragma applies to all entities). It specifies that the function @code{Entity} is to be considered pure for the purposes of code generation. This means that the compiler can assume that there are no side effects, and -in particular that two calls with identical arguments produce the -same result. It also means that the function can be used in an -address clause. +in particular that two identical calls produce the same result in +the same context. It also means that the function can be used in +an address clause. Note that, quite deliberately, there are no static checks to try to ensure that this promise is met, so @code{Pure_Function} can be used |