aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYannick Moy <moy@adacore.com>2020-11-04 16:11:51 +0100
committerPierre-Marie de Rodat <derodat@adacore.com>2020-11-27 04:15:58 -0500
commitfdd0a8448945618a6756d474b7c931fabc51ad0f (patch)
tree17822e4958538ccdb650db4d0a839928bdffb9a1
parent9884fc7e79e0753299169a5045ba054520896ac6 (diff)
downloadgcc-fdd0a8448945618a6756d474b7c931fabc51ad0f.zip
gcc-fdd0a8448945618a6756d474b7c931fabc51ad0f.tar.gz
gcc-fdd0a8448945618a6756d474b7c931fabc51ad0f.tar.bz2
[Ada] Do not apply range checks inside generics in GNATprove mode
gcc/ada/ * checks.adb (Selected_Range_Checks): Adapt the condition for applying range checks so that it is not done inside generics.
-rw-r--r--gcc/ada/checks.adb6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb
index c7a3321..803bd21 100644
--- a/gcc/ada/checks.adb
+++ b/gcc/ada/checks.adb
@@ -10585,10 +10585,10 @@ package body Checks is
begin
-- Checks will be applied only when generating code. In GNATprove mode,
-- we do not apply the checks, but we still call Selected_Range_Checks
- -- to possibly issue errors on SPARK code when a run-time error can be
- -- detected at compile time.
+ -- outside of generics to possibly issue errors on SPARK code when a
+ -- run-time error can be detected at compile time.
- if not Expander_Active and not GNATprove_Mode then
+ if Inside_A_Generic or (not GNATprove_Mode and not Expander_Active) then
return Ret_Result;
end if;