From: Yannick Moy Date: Wed, 4 Nov 2020 15:11:51 +0000 (+0100) Subject: [Ada] Do not apply range checks inside generics in GNATprove mode X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fdd0a8448945618a6756d474b7c931fabc51ad0f;p=gcc.git [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. --- diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb index c7a33217064..803bd21a586 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;