From: Eric Botcazou Date: Wed, 29 Jan 2020 15:15:09 +0000 (+0100) Subject: [Ada] Add missing conversion in call to Finalize primitive X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=25a76d621a4b6e324777677c8a5a81c09da2db9d;p=gcc.git [Ada] Add missing conversion in call to Finalize primitive 2020-06-04 Eric Botcazou gcc/ada/ * exp_ch7.adb (Make_Final_Call): Set the type of the object, if it is unanalyzed, before calling Convert_View on it. --- diff --git a/gcc/ada/exp_ch7.adb b/gcc/ada/exp_ch7.adb index fbdef9be497..ed4e8c570e6 100644 --- a/gcc/ada/exp_ch7.adb +++ b/gcc/ada/exp_ch7.adb @@ -8432,6 +8432,15 @@ package body Exp_Ch7 is end if; end; + -- If the object is unanalyzed, set its expected type for use in + -- Convert_View in case an additional conversion is needed. + + if No (Etype (Ref)) + and then Nkind (Ref) /= N_Unchecked_Type_Conversion + then + Set_Etype (Ref, Typ); + end if; + Ref := Convert_View (Fin_Id, Ref); end if;