aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch5.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/sem_ch5.adb')
-rw-r--r--gcc/ada/sem_ch5.adb10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb
index 7a8d0cc..63bb80c 100644
--- a/gcc/ada/sem_ch5.adb
+++ b/gcc/ada/sem_ch5.adb
@@ -3028,6 +3028,10 @@ package body Sem_Ch5 is
then
Analyze_And_Resolve (Original_Bound, Typ);
return Original_Bound;
+
+ elsif Inside_Class_Condition_Preanalysis then
+ Analyze_And_Resolve (Original_Bound, Typ);
+ return Original_Bound;
end if;
-- Normally, the best approach is simply to generate a constant
@@ -3333,11 +3337,17 @@ package body Sem_Ch5 is
-- or post-condition has been expanded. Update the type of the loop
-- variable to reflect the proper itype at each stage of analysis.
+ -- Loop_Nod might not be present when we are preanalyzing a class-wide
+ -- pre/postcondition since preanalysis occurs in a place unrelated to
+ -- the actual code and the quantified expression may be the outermost
+ -- expression of the class-wide condition.
+
if No (Etype (Id))
or else Etype (Id) = Any_Type
or else
(Present (Etype (Id))
and then Is_Itype (Etype (Id))
+ and then Present (Loop_Nod)
and then Nkind (Parent (Loop_Nod)) = N_Expression_With_Actions
and then Nkind (Original_Node (Parent (Loop_Nod))) =
N_Quantified_Expression)