aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJavier Miranda <miranda@adacore.com>2020-05-26 14:54:15 -0400
committerGiuliano Belinassi <giuliano.belinassi@usp.br>2020-08-17 13:17:10 -0300
commit7a2335c42f4acb7a425b6e7e05a218d1e10f34d8 (patch)
tree68df2973bb541eff69cd4ac0bfc2ef9e4e7e1f44
parentbdb1a887253905742d9af3894b20e905fe5b2ecc (diff)
downloadgcc-7a2335c42f4acb7a425b6e7e05a218d1e10f34d8.zip
gcc-7a2335c42f4acb7a425b6e7e05a218d1e10f34d8.tar.gz
gcc-7a2335c42f4acb7a425b6e7e05a218d1e10f34d8.tar.bz2
[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).
-rw-r--r--gcc/ada/exp_ch6.adb3
1 files changed, 2 insertions, 1 deletions
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);