From: Gary Dismukes Date: Fri, 22 Aug 2008 14:56:20 +0000 (+0200) Subject: exp_aggr.adb (Static_Array_Aggregate): Call Analyze_And_Resolve on the component... X-Git-Tag: releases/gcc-4.4.0~2934 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9b4b0a1ac996ea8e38ff857fb171f3cd1f6a45a5;p=thirdparty%2Fgcc.git exp_aggr.adb (Static_Array_Aggregate): Call Analyze_And_Resolve on the component expression copies rather than... 2008-08-22 Gary Dismukes * 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 --- diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb index c81e401381dc..df5617a09fc6 100644 --- a/gcc/ada/exp_aggr.adb +++ b/gcc/ada/exp_aggr.adb @@ -6441,13 +6441,13 @@ package body Exp_Aggr is loop Append_To (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 - Set_Is_Static_Expression (Last (Expressions (Agg))); - end if; + Analyze_And_Resolve + (Last (Expressions (Agg)), Component_Type (Typ)); end loop; Set_Aggregate_Bounds (Agg, Bounds); @@ -6464,4 +6464,5 @@ package body Exp_Aggr is return False; end if; end Static_Array_Aggregate; + end Exp_Aggr;