2011-08-02 Ed Schonberg <schonberg@adacore.com>
* sem_aggr.adb (Resolve_Array_Aggregate): when copying the expression
in an association, set parent field of copy before partial analysis.
* sem_res.adb (Resolve_Slice): create reference to itype only when
expansion is enabled.
From-SVN: r177178
+2011-08-02 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_aggr.adb (Resolve_Array_Aggregate): when copying the expression
+ in an association, set parent field of copy before partial analysis.
+ * sem_res.adb (Resolve_Slice): create reference to itype only when
+ expansion is enabled.
+
2011-08-02 Yannick Moy <moy@adacore.com>
* einfo.adb, einfo.ads (Body_Is_In_ALFA, Set_Body_Is_In_ALFA): get/set
begin
Expander_Mode_Save_And_Set (False);
Full_Analysis := False;
+
+ -- Analyze the expression, making sure it is properly
+ -- attached to the tree before we do the analysis.
+
+ Set_Parent (Expr, Parent (Expression (Assoc)));
Analyze (Expr);
-- If the expression is a literal, propagate this info
-- so that the itype is frozen at the proper place in the tree (i.e. at
-- the point where actions for the slice are analyzed). Note that this
-- is different from freezing the itype immediately, which might be
- -- premature (e.g. if the slice is within a transient scope).
+ -- premature (e.g. if the slice is within a transient scope). This needs
+ -- to be done only if expansion is enabled.
- else
+ elsif Expander_Active then
Ensure_Defined (Typ => Slice_Subtype, N => N);
end if;
end Set_Slice_Subtype;