From: Javier Miranda Date: Tue, 26 May 2020 18:54:15 +0000 (-0400) Subject: [Ada] Spurious error in generic dispatching constructor call X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4e91f87c3e7b76af8a73b52498f76aa3aea50b69;p=gcc.git [Ada] Spurious error in generic dispatching constructor call gcc/ada/ * exp_ch6.adb (Make_Build_In_Place_Iface_Call_In_Allocator): Build the internal anonymous access type using as a reference the designated type imposed by the context (instead of using the return type of the called function). --- diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb index 776ff49daea..329f3b53a9c 100644 --- a/gcc/ada/exp_ch6.adb +++ b/gcc/ada/exp_ch6.adb @@ -9709,7 +9709,8 @@ package body Exp_Ch6 is -- declaration. Anon_Type := Create_Itype (E_Anonymous_Access_Type, Function_Call); - Set_Directly_Designated_Type (Anon_Type, Etype (BIP_Func_Call)); + Set_Directly_Designated_Type (Anon_Type, + Designated_Type (Etype (Allocator))); Set_Etype (Anon_Type, Anon_Type); Build_Class_Wide_Master (Anon_Type);