+2013-04-11 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * exp_ch4.adb (Process_Transient_Object): Use
+ an unchecked conversion when associating a transient controlled
+ object with its "hook".
+
+2013-04-11 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_prag.adb (Analyze_Pragma, case
+ Preelaborable_Initialization): The pragma is legal if it comes
+ from an aspect on the private view of the type, even though its
+ analysis point takes place later at the freeze point.
+
2013-04-11 Robert Dewar <dewar@adacore.com>
* sem_ch6.adb: Minor reformatting.
-- Step 3: Hook the transient object to the temporary
if Is_Access_Type (Obj_Typ) then
- Expr := Convert_To (Ptr_Id, New_Reference_To (Obj_Id, Loc));
+
+ -- Why is this an unchecked conversion ???
+ Expr :=
+ Unchecked_Convert_To (Ptr_Id, New_Reference_To (Obj_Id, Loc));
else
Expr :=
Make_Attribute_Reference (Loc,
Check_First_Subtype (Arg1);
Ent := Entity (Get_Pragma_Arg (Arg1));
- if not (Is_Private_Type (Ent)
- or else
- Is_Protected_Type (Ent)
- or else
- (Is_Generic_Type (Ent) and then Is_Derived_Type (Ent)))
+ -- The pragma may come from an aspect on a private declaration,
+ -- even if the freeze point at which this is analyzed in the
+ -- private part after the full view.
+
+ if Has_Private_Declaration (Ent)
+ and then From_Aspect_Specification (N)
+ then
+ null;
+
+ elsif Is_Private_Type (Ent)
+ or else Is_Protected_Type (Ent)
+ or else (Is_Generic_Type (Ent) and then Is_Derived_Type (Ent))
then
+ null;
+
+ else
Error_Pragma_Arg
("pragma % can only be applied to private, formal derived or "
& "protected type",