Commit 9b4b0a1a by Gary Dismukes Committed by Arnaud Charlet

exp_aggr.adb (Static_Array_Aggregate): Call Analyze_And_Resolve on the component…

exp_aggr.adb (Static_Array_Aggregate): Call Analyze_And_Resolve on the component expression copies rather than...

2008-08-22  Gary Dismukes  <dismukes@adacore.com>

	* exp_aggr.adb (Static_Array_Aggregate): Call Analyze_And_Resolve on the
	component expression copies rather than directly setting Etype and
	Is_Static_Expression.

From-SVN: r139479
parent b7cc33a4
...@@ -6441,13 +6441,13 @@ package body Exp_Aggr is ...@@ -6441,13 +6441,13 @@ package body Exp_Aggr is
loop loop
Append_To Append_To
(Expressions (Agg), New_Copy (Expression (Expr))); (Expressions (Agg), New_Copy (Expression (Expr)));
Set_Etype (Last (Expressions (Agg)), Component_Type (Typ));
-- Integer literals should always be marked as static -- The copied expression must be analyzed and resolved.
-- Besides setting the type, this ensures that static
-- expressions are appropriately marked as such.
if Nkind (Expression (Expr)) = N_Integer_Literal then Analyze_And_Resolve
Set_Is_Static_Expression (Last (Expressions (Agg))); (Last (Expressions (Agg)), Component_Type (Typ));
end if;
end loop; end loop;
Set_Aggregate_Bounds (Agg, Bounds); Set_Aggregate_Bounds (Agg, Bounds);
...@@ -6464,4 +6464,5 @@ package body Exp_Aggr is ...@@ -6464,4 +6464,5 @@ package body Exp_Aggr is
return False; return False;
end if; end if;
end Static_Array_Aggregate; end Static_Array_Aggregate;
end Exp_Aggr; end Exp_Aggr;
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