This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Ada] Assertion_Policy for class-wide precondition
- From: Pierre-Marie de Rodat <derodat at adacore dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Bob Duff <duff at adacore dot com>
- Date: Tue, 17 Jul 2018 04:24:08 -0400
- Subject: [Ada] Assertion_Policy for class-wide precondition
This patch fixes the compiler to that class-wide preconditions on primitive
operations of interfaces are not checked at run time when the Assertion_Policy
indicates that they should be ignored. This is required by the RM.
Tested on x86_64-pc-linux-gnu, committed on trunk
2018-07-17 Bob Duff <duff@adacore.com>
gcc/ada/
* exp_disp.adb (Build_Class_Wide_Check): Return early if the
precondition is supposed to be ignored.
--- gcc/ada/exp_disp.adb
+++ gcc/ada/exp_disp.adb
@@ -809,7 +809,7 @@ package body Exp_Disp is
Prec := Next_Pragma (Prec);
end loop;
- if No (Prec) then
+ if No (Prec) or else Is_Ignored (Prec) then
return;
end if;