gcc/ada/
* sem_ch13.adb (Build_Predicate_Functions): If a semantic error
has been detected then ignore Predicate_Failure aspect
specifications in the same way as is done for CodePeer and
SPARK. This avoids an internal compiler error if
Ancestor_Predicate_Function_Called is True but Result_Expr is
not an N_And_Then node (and is therefore unsuitable as an
argument in a call to Left_Opnd).
begin
-- 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.
+ -- comes from the Predicate_Failure. Ditto for CodePeer.
+ -- And an illegal Predicate_Failure aspect can lead to cases
+ -- we want to avoid.
if Present (PF_Expr)
and then not GNATprove_Mode
and then not CodePeer_Mode
+ and then Serious_Errors_Detected = 0
then
pragma Assert (Present (Second_Formal));