]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Adjust description of Pure_Function pragma
authorEric Botcazou <ebotcazou@adacore.com>
Mon, 23 May 2022 07:48:49 +0000 (09:48 +0200)
committerPierre-Marie de Rodat <derodat@adacore.com>
Mon, 4 Jul 2022 07:45:50 +0000 (07:45 +0000)
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.

gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst
gcc/ada/gnat_rm.texi

index af85600f32aa826fd2ad4e758a05277c1fb89ccb..4318a347028a4b9b2a099a6257732c8af06d009c 100644 (file)
@@ -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
index a7077e05b47021acabe2bac0751fd2e4158c01b9..13cff21288fcf10d1b09049e9c59578ac0c530f3 100644 (file)
@@ -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