---------------------------------
procedure Expand_Allocator_Expression (N : Node_Id) is
- Loc : constant Source_Ptr := Sloc (N);
- Exp : constant Node_Id := Expression (Expression (N));
- PtrT : constant Entity_Id := Etype (N);
- DesigT : constant Entity_Id := Designated_Type (PtrT);
+ Loc : constant Source_Ptr := Sloc (N);
+ Exp : constant Node_Id := Expression (Expression (N));
+ Indic : constant Node_Id := Subtype_Mark (Expression (N));
+ T : constant Entity_Id := Entity (Indic);
+ PtrT : constant Entity_Id := Etype (N);
+ DesigT : constant Entity_Id := Designated_Type (PtrT);
+ Special_Return : constant Boolean := For_Special_Return_Object (N);
-- Local variables
- Indic : constant Node_Id := Subtype_Mark (Expression (N));
- T : constant Entity_Id := Entity (Indic);
Adj_Call : Node_Id;
Aggr_In_Place : Boolean;
Node : Node_Id;
-- Likewise if the allocator is made for a special return object
- elsif For_Special_Return_Object (N) then
+ elsif Special_Return then
null;
elsif Is_Tagged_Type (T) and then not Is_Class_Wide_Type (T) then
and then not Is_Inherently_Limited_Type (T)
and then not Aggr_In_Place
and then Nkind (Exp) /= N_Function_Call
- and then not For_Special_Return_Object (N)
+ and then not Special_Return
then
-- An unchecked conversion is needed in the classwide case because
-- the designated type can be an ancestor of the subtype mark of