aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_res.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/sem_res.adb')
-rw-r--r--gcc/ada/sem_res.adb17
1 files changed, 3 insertions, 14 deletions
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb
index de5053c..0595b0b 100644
--- a/gcc/ada/sem_res.adb
+++ b/gcc/ada/sem_res.adb
@@ -11065,22 +11065,11 @@ package body Sem_Res is
end;
end if;
- -- Ada 2012: if target type has predicates, the result requires a
- -- predicate check. If the context is a call to another predicate
- -- check we must prevent infinite recursion.
+ -- Ada 2012: once the type conversion is resolved, check whether the
+ -- operand statisfies the static predicate of the target type.
if Has_Predicates (Target_Typ) then
- if Nkind (Parent (N)) = N_Function_Call
- and then Present (Name (Parent (N)))
- and then (Is_Predicate_Function (Entity (Name (Parent (N))))
- or else
- Is_Predicate_Function_M (Entity (Name (Parent (N)))))
- then
- null;
-
- else
- Apply_Predicate_Check (N, Target_Typ);
- end if;
+ Check_Expression_Against_Static_Predicate (N, Target_Typ);
end if;
-- If at this stage we have a real to integer conversion, make sure that