[Ada] Spurious error in generic dispatching constructor
gcc/ada/ * exp_ch6.adb (Make_Build_In_Place_Iface_Call_In_Allocator): Revert previous patch, and add a missing type conversion to displace the pointer to the allocated object to reference the target dispatch table.
This commit is contained in:
parent
36f0cf4e60
commit
84ae33e7f5
@ -9726,8 +9726,7 @@ package body Exp_Ch6 is
|
|||||||
-- declaration.
|
-- declaration.
|
||||||
|
|
||||||
Anon_Type := Create_Itype (E_Anonymous_Access_Type, Function_Call);
|
Anon_Type := Create_Itype (E_Anonymous_Access_Type, Function_Call);
|
||||||
Set_Directly_Designated_Type (Anon_Type,
|
Set_Directly_Designated_Type (Anon_Type, Etype (BIP_Func_Call));
|
||||||
Designated_Type (Etype (Allocator)));
|
|
||||||
Set_Etype (Anon_Type, Anon_Type);
|
Set_Etype (Anon_Type, Anon_Type);
|
||||||
Build_Class_Wide_Master (Anon_Type);
|
Build_Class_Wide_Master (Anon_Type);
|
||||||
|
|
||||||
@ -9757,7 +9756,12 @@ package body Exp_Ch6 is
|
|||||||
(Allocator => Expression (Tmp_Decl),
|
(Allocator => Expression (Tmp_Decl),
|
||||||
Function_Call => Expression (Expression (Tmp_Decl)));
|
Function_Call => Expression (Expression (Tmp_Decl)));
|
||||||
|
|
||||||
Rewrite (Allocator, New_Occurrence_Of (Tmp_Id, Loc));
|
-- Add a conversion to displace the pointer to the allocated object
|
||||||
|
-- to reference the corresponding dispatch table.
|
||||||
|
|
||||||
|
Rewrite (Allocator,
|
||||||
|
Convert_To (Etype (Allocator),
|
||||||
|
New_Occurrence_Of (Tmp_Id, Loc)));
|
||||||
end Make_Build_In_Place_Iface_Call_In_Allocator;
|
end Make_Build_In_Place_Iface_Call_In_Allocator;
|
||||||
|
|
||||||
---------------------------------------------------------
|
---------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user