]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Allow IN OUT parameters for first parameter of traversal functions
authorClaire Dross <dross@adacore.com>
Wed, 12 Feb 2025 11:10:20 +0000 (12:10 +0100)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Fri, 6 Jun 2025 08:37:04 +0000 (10:37 +0200)
commit8abecb35be8fd6790e9b7ec7c28cfee075d9c9e5
tree25cd9d5e9f952fd9eae17517bc1c7ff0d628fc6a
parent537453af7c83432f5bde527f035f9dbb43921fd3
ada: Allow IN OUT parameters for first parameter of traversal functions

In general, functions in SPARK cannot have parameters of mode IN OUT
unless they are annotated with the Side_Effects aspect. Borrowing
traversal functions are special functions which can return a part
of their first parameter as an access-to-variable type. This might not
be allowed in Ada if the parameter is a constant. Allow the first
parameter of borrowing traversal functions to have mode IN OUT.

gcc/ada/ChangeLog:

* sem_ch6.adb (Analyze_SPARK_Subprogram_Specification):
Allow the first parameter of functions whose return type is
an anonymous access-to-variable type to have mode IN OUT.
gcc/ada/sem_ch6.adb