[Ada] PR ada/105303 Fix use of Assertion_Policy in internal generics unit
authorYannick Moy <moy@adacore.com>
Tue, 19 Apr 2022 12:37:58 +0000 (14:37 +0200)
committerPierre-Marie de Rodat <derodat@adacore.com>
Mon, 30 May 2022 08:29:01 +0000 (08:29 +0000)
commit5b7630f2f266346173eb2172a9a96e925010afc5
tree889dbf90ca325cfd1b07387625fb105d5a5fd02c
parent55c19dda8c6c5fd40f1ec7ea4dd2f0c12d8c309f
[Ada] PR ada/105303 Fix use of Assertion_Policy in internal generics unit

The internal unit System.Generic_Array_Operations defines only generic
subprograms. Thus, pragma Assertion_Policy inside the spec has no
effect, as each instantiation is only subject to the assertion policy at
the program point of the instantiation. Remove this confusing pragma,
and add the pragma inside each generic body making use of additional
assertions or ghost code, so that running time of instantiations is not
impacted by assertions meant for formal verification.

gcc/ada/

PR ada/105303
* libgnat/s-gearop.adb: Add pragma Assertion_Policy in generic
bodies making use of additional assertions or ghost code.
* libgnat/s-gearop.ads: Remove confusing Assertion_Policy.
gcc/ada/libgnat/s-gearop.adb
gcc/ada/libgnat/s-gearop.ads