]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Fix handling of SPARK_Mode on standalone child subprogram
authorYannick Moy <moy@adacore.com>
Wed, 17 Jul 2024 08:43:06 +0000 (10:43 +0200)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Fri, 2 Aug 2024 07:08:11 +0000 (09:08 +0200)
commitce7f7b92505e59ae517b05493694be2102cadf5a
tree83c227cc8bf4fbdae69f62664227e4d0e1bacecd
parentd8a27bb9a7d932b3a3f8b1ffc9e156f698d08aee
ada: Fix handling of SPARK_Mode on standalone child subprogram

SPARK_Mode aspect was not properly propagated to the body of
a standalone child subprogram from the generated spec for that subprogram,
leading GNATprove to not analyze this body. Now fixed.

gcc/ada/

* aspects.adb (Find_Aspect): Take into account the case of a node
of kind N_Defining_Program_Unit_Name.
* sem_ch10.adb (Analyze_Compilation_Unit): Copy the SPARK aspect
from the spec to the body. Delay semantic analysis after that
point to ensure that SPARK_Mode is properly analyzed.
gcc/ada/aspects.adb
gcc/ada/sem_ch10.adb