diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2023-01-03 08:20:30 +0100 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2023-01-16 15:44:54 +0100 |
commit | e59cd0db822e325868128281a81ee356a6914f52 (patch) | |
tree | 2519bdceb870b4a55e683a259dcac681e9c54a13 /gcc/ada | |
parent | 24993939b7e405cdb8fa7ab6b388913a5d9fb6ce (diff) | |
download | gcc-e59cd0db822e325868128281a81ee356a6914f52.zip gcc-e59cd0db822e325868128281a81ee356a6914f52.tar.gz gcc-e59cd0db822e325868128281a81ee356a6914f52.tar.bz2 |
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.
Diffstat (limited to 'gcc/ada')
-rw-r--r-- | gcc/ada/exp_ch3.adb | 2 |
1 files changed, 1 insertions, 1 deletions
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); |