[Ada] Checking type invariants on in params of procedures, not functions (AI12-0044)
authorGary Dismukes <dismukes@adacore.com>
Mon, 11 May 2020 14:34:26 +0000 (10:34 -0400)
committerPierre-Marie de Rodat <derodat@adacore.com>
Tue, 7 Jul 2020 09:26:55 +0000 (05:26 -0400)
commit58e07eaae447b73763ae390a13a613a6b70679ce
treeaead85c6db7ae2183e7a3b9e16c8681f0cc8b627
parent845c49360bca4553676d5a33603d5099e7cf6d85
[Ada] Checking type invariants on in params of procedures, not functions (AI12-0044)

gcc/ada/

* contracts.adb (Add_Invariant_And_Predicate_Checks): Relax the
condition for doing invariant checks so that in-mode parameters
of procedures are also checked (required by AI05-0289, and
restricted to procedures by AI12-0044). This is done in a
procedure's nested postconditions procedure.
* exp_ch6.adb (Expand_Actuals): Also perform postcall invariant
checks for in parameters of procedures (but not functions).
Moved invariant-checking code to end of Expand_Actuals
(including the nested function Is_Public_Subp).
gcc/ada/contracts.adb
gcc/ada/exp_ch6.adb