]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Fix propagation of SPARK_Mode for renaming-as-body
authorYannick Moy <moy@adacore.com>
Mon, 22 Jul 2024 09:31:03 +0000 (11:31 +0200)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Tue, 6 Aug 2024 08:54:30 +0000 (10:54 +0200)
commit439af1ef21d0d96b1f48d86e8c978e9af81490bc
tree0873601f69171ed27e90bc43494e1ffa01e9f3f3
parent070f973cd3b99ed57cd40582fa90eb08dc5f84c4
ada: Fix propagation of SPARK_Mode for renaming-as-body

The value of SPARK_Mode associated with a renaming-as-body might
not be the correct one, when the private part of the package containing
the declaration has SPARK_Mode Off while the public part has SPARK_Mode
On. This may lead to analysis of code by GNATprove that should not be
analyzed.

gcc/ada/

* freeze.adb (Build_Renamed_Body): Propagate SPARK_Pragma to body
build from renaming, so that locally relevant value is taken into
account.
* sem_ch6.adb (Analyze_Expression_Function): Propagate
SPARK_Pragma to body built from expression function, so that
locally relevant value is taken into account.
gcc/ada/freeze.adb
gcc/ada/sem_ch6.adb