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.
This commit is contained in:
Eric Botcazou 2023-01-03 08:20:30 +01:00 committed by Marc Poulhiès
parent 24993939b7
commit e59cd0db82

View file

@ -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);