From: Piotr Trojanek Date: Wed, 13 Apr 2022 19:39:38 +0000 (+0200) Subject: [Ada] Ignore Predicate_Failure in GNATprove mode X-Git-Tag: basepoints/gcc-14~6558 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eff70bcc1f1e808e3cc253a8452b7849329d549a;p=thirdparty%2Fgcc.git [Ada] Ignore Predicate_Failure in GNATprove mode In GNATprove mode we are don't want predicate failure to pollute the predicate expression extracted from the predicate function. gcc/ada/ * sem_ch13.adb (Build_Predicate_Function): Ignore predicate failure in GNATprove mode. --- diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index 54f32a2fc49..c12253cf26a 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -10487,7 +10487,13 @@ package body Sem_Ch13 is Second_Formal : constant Entity_Id := Next_Entity (Object_Entity); begin - if Present (PF_Expr) then + -- In GNATprove mode we are only interested in the predicate + -- expression itself and don't want a raise expression that + -- comes from the Predicate_Failure. + + if Present (PF_Expr) + and then not GNATprove_Mode + then pragma Assert (Present (Second_Formal)); -- This is an ugly hack to cope with an ugly situation.