Commit a096f12e by Ed Schonberg Committed by Pierre-Marie de Rodat

[Ada] Missing Predicated_Parent link on array Itype

2019-10-10  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

	* sem_aggr.adb (Resolve_Array_Aggregate): Set properly the
	Predicated_Parent link of an itype created for an aggregate, so
	that the predicate_function of the parent can support proofs on
	the object that it initializes.

From-SVN: r276823
parent f200341c
2019-10-10 Eric Botcazou <ebotcazou@adacore.com> 2019-10-10 Ed Schonberg <schonberg@adacore.com>
* sem_ch3.adb (Analyze_Number_Declaration): Set * sem_aggr.adb (Resolve_Array_Aggregate): Set properly the
Debug_Info_Needed in the case where the expression is an integer Predicated_Parent link of an itype created for an aggregate, so
literal. that the predicate_function of the parent can support proofs on
\ No newline at end of file the object that it initializes.
\ No newline at end of file
...@@ -614,10 +614,17 @@ package body Sem_Aggr is ...@@ -614,10 +614,17 @@ package body Sem_Aggr is
if Has_Predicates (Typ) then if Has_Predicates (Typ) then
Set_Has_Predicates (Itype); Set_Has_Predicates (Itype);
-- If the base type has a predicate, capture the predicated parent
-- or the existing predicate function for SPARK use.
if Present (Predicate_Function (Typ)) then if Present (Predicate_Function (Typ)) then
Set_Predicate_Function (Itype, Predicate_Function (Typ)); Set_Predicate_Function (Itype, Predicate_Function (Typ));
else
elsif Is_Itype (Typ) then
Set_Predicated_Parent (Itype, Predicated_Parent (Typ)); Set_Predicated_Parent (Itype, Predicated_Parent (Typ));
else
Set_Predicated_Parent (Itype, Typ);
end if; end if;
end if; end if;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment