diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2020-01-29 16:15:09 +0100 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2020-06-04 05:11:17 -0400 |
commit | 25a76d621a4b6e324777677c8a5a81c09da2db9d (patch) | |
tree | b47b366319f24449f6a866dbd7b3526286994229 | |
parent | 3ab26de1c003d0ac640eaa114e041bf78fb151ac (diff) | |
download | gcc-25a76d621a4b6e324777677c8a5a81c09da2db9d.zip gcc-25a76d621a4b6e324777677c8a5a81c09da2db9d.tar.gz gcc-25a76d621a4b6e324777677c8a5a81c09da2db9d.tar.bz2 |
[Ada] Add missing conversion in call to Finalize primitive
2020-06-04 Eric Botcazou <ebotcazou@adacore.com>
gcc/ada/
* exp_ch7.adb (Make_Final_Call): Set the type of the object, if
it is unanalyzed, before calling Convert_View on it.
-rw-r--r-- | gcc/ada/exp_ch7.adb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/ada/exp_ch7.adb b/gcc/ada/exp_ch7.adb index fbdef9b..ed4e8c5 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; |