[Ada] Accept calls to abstract subprograms in class-wide pre/post-conditions
authorJavier Miranda <miranda@adacore.com>
Tue, 8 Mar 2022 22:55:16 +0000 (14:55 -0800)
committerPierre-Marie de Rodat <derodat@adacore.com>
Mon, 16 May 2022 08:42:04 +0000 (08:42 +0000)
commite6bdaa0299d459e4f0486793bcbeff1bbe75f8a1
tree1c6c604a13a220279b9693b722f0ffa548a40c6b
parent146ea83af978384b0f7dabc8176f8bf98892ce2a
[Ada] Accept calls to abstract subprograms in class-wide pre/post-conditions

Fix a regression in the support for Ada 2022's treatment of calls to
abstract subprograms in pre/post-conditions (thanks to Javier Miranda
for producing this patch).

gcc/ada/

* sem_disp.adb (Check_Dispatching_Context): When checking to see
whether an expression occurs in a class-wide pre/post-condition,
also check for the possibility that it occurs in a class-wide
preconditions subprogram that was introduced as part of
expansion. Without this fix, some legal calls occuring in
class-wide preconditions may be incorrectly flagged as violating
the "a call to an abstract subprogram must be dispatching" rule.
gcc/ada/sem_disp.adb