[Ada] Another case where freezing incorrectly suppresses checks
authorSteve Baird <baird@adacore.com>
Wed, 4 May 2022 23:23:40 +0000 (16:23 -0700)
committerPierre-Marie de Rodat <derodat@adacore.com>
Wed, 1 Jun 2022 08:43:18 +0000 (08:43 +0000)
commitb1743c7de2cc3473d5efc2f16495acd2b71d7591
treed35968d31e0ea463216ec9b0cd4ed3c6e32d9c27
parent378523d4a316fa42580915a74c30aa77a0b5e85c
[Ada] Another case where freezing incorrectly suppresses checks

Avoid improperly suppressing checks for the wrapper subprogram that is
built when a null type extension inherits (and does not override) a
function with a controlling result. This is a follow-up to other changes
already made on this ticket.

gcc/ada/

* exp_ch3.adb (Make_Controlling_Function_Wrappers): Set the
Corresponding_Spec field of a wrapper subprogram body before
analyzing the subprogram body; the field will be set (again)
during analysis, but we need it to be set earlier.
* exp_ch13.adb (Expand_N_Freeze_Entity): Add wrapper subprogram
bodies to the list of declarations for which we do not want to
suppress checks.
gcc/ada/exp_ch13.adb
gcc/ada/exp_ch3.adb