]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Fix bug in Sem_Util.Enclosing_Declaration
authorSteve Baird <baird@adacore.com>
Thu, 7 Dec 2023 20:18:29 +0000 (12:18 -0800)
committerMarc Poulhiès <poulhies@adacore.com>
Tue, 9 Jan 2024 13:13:30 +0000 (14:13 +0100)
commit7d4c4a4d21aceabf7bae4eec608d2c6f22fc9d76
treef6f78856a2d881871fbfd7a72df96e2bc6ef93d9
parent85f0ae3c54ad48e62ca02e61a1aa1ab3c8664142
ada: Fix bug in Sem_Util.Enclosing_Declaration

Fix Sem_Util.Enclosing_Declaration to not return an N_Subprogram_Specification
node. Remove code in various places that was formerly needed to cope with this
misbehavior.

gcc/ada/

* sem_util.adb (Enclosing_Declaration): Instead of returning a
subprogram specification node, return its parent (which is
presumably a subprogram declaration).
* contracts.adb (Insert_Stable_Property_Check): Remove code
formerly needed to compensate for incorrect behavior of
Sem_Util.Enclosing_Declaration.
* exp_attr.adb (In_Available_Context): Remove code formerly needed
to compensate for incorrect behavior of
Sem_Util.Enclosing_Declaration.
* sem_ch8.adb (Is_Actual_Subp_Of_Inst): Remove code formerly
needed to compensate for incorrect behavior of
Sem_Util.Enclosing_Declaration.
gcc/ada/contracts.adb
gcc/ada/exp_attr.adb
gcc/ada/sem_ch8.adb
gcc/ada/sem_util.adb