From 4e91f87c3e7b76af8a73b52498f76aa3aea50b69 Mon Sep 17 00:00:00 2001 From: Javier Miranda Date: Tue, 26 May 2020 14:54:15 -0400 Subject: [PATCH] [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). --- gcc/ada/exp_ch6.adb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb index 776ff49..329f3b5 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); -- 2.7.4