ada: Fix spurious error in checking of SPARK elaboration
The problem is that the computation of early call regions skips freeze nodes
but scenarios involving procedures declared as actions of these freeze nodes
are taken into account. As a consequence if a subprogram body, typically of
an expression function, is placed just after a freeze node, its early call
region depends on whether the construct just before the freeze node can be
preelaborated or not; in other words, the legality of calls made from the
actions of this freeze node to the subprogram depends on what happens ahead
of the freeze node, which may be totally unrelated to the situation.
This change disables the ABE diagnostics in this case, as is done in a few
other similar cases leading to bogus errors too.
gcc/ada/
* sem_elab.adb (Processing_In_State): Add Within_Freezing_Actions
component.
(Process_Conditional_ABE_Call): Compute its value.
(Process_Conditional_ABE_Call_SPARK): For a call and a target in
the main unit, do not emit any ABE diagnostics if the call occurs
in a freezing actions context.