From: Eric Botcazou Date: Tue, 3 Jan 2023 07:20:30 +0000 (+0100) Subject: ada: Put back conversion to interface in more cases X-Git-Tag: upstream/13.1.0~2039 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e59cd0db822e325868128281a81ee356a6914f52;p=platform%2Fupstream%2Fgcc.git ada: Put back conversion to interface in more cases This needs to be done for all expressions with class-wide type. gcc/ada/ * exp_ch3.adb (Make_Allocator_For_Return): Put back an interface conversion for expressions with non-interface class-wide type. --- diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb index c866a9c..84594ed 100644 --- a/gcc/ada/exp_ch3.adb +++ b/gcc/ada/exp_ch3.adb @@ -7185,7 +7185,7 @@ package body Exp_Ch3 is -- remove earlier in the processing. if Is_Interface (Typ) - and then Is_Interface (Etype (Alloc_Expr)) + and then Is_Class_Wide_Type (Etype (Alloc_Expr)) and then Typ /= Etype (Alloc_Expr) then Alloc_Expr := Convert_To (Typ, Alloc_Expr);