]> git.ipfire.org Git - thirdparty/gcc.git/commit
[Ada] Valid postconditions incorrectly rejected.
authorSteve Baird <baird@adacore.com>
Fri, 1 Oct 2021 00:36:38 +0000 (17:36 -0700)
committerPierre-Marie de Rodat <derodat@adacore.com>
Mon, 11 Oct 2021 13:38:12 +0000 (13:38 +0000)
commit939047f542ddbe43a36d755a39ba3b531bb5d8cc
tree9fc6e24775456cbde0dbcc8c409690209a50ebfa
parent2ad5d5e3d5d40f220df7239b54d5017259dc4d1d
[Ada] Valid postconditions incorrectly rejected.

gcc/ada/

* sem_attr.adb (Analyze_Attribute_Old_Result): Permit an
attribute reference inside a compiler-generated _Postconditions
procedure. In this case, Subp_Decl is assigned the declaration
of the enclosing subprogram.
* exp_util.adb (Insert_Actions): When climbing up the tree
looking for an insertion point, do not climb past an
N_Iterated_Component/Element_Association, since this could
result in inserting a reference to a loop parameter at a
location outside of the scope of that loop parameter. On the
other hand, be careful to preserve existing behavior in the case
of an N_Component_Association node.
gcc/ada/exp_util.adb
gcc/ada/sem_attr.adb