diff options
author | Javier Miranda <miranda@adacore.com> | 2022-11-19 19:46:31 +0000 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2022-12-06 14:58:49 +0100 |
commit | 7dc44f280e7d1126b4d05e79c53b40df1afe334a (patch) | |
tree | 8c6cecf26e1939c4e299abc1bf2332462647238c | |
parent | 188965afb10a2bf14527f2aa9f9cb0f8fcc991e9 (diff) | |
download | gcc-7dc44f280e7d1126b4d05e79c53b40df1afe334a.zip gcc-7dc44f280e7d1126b4d05e79c53b40df1afe334a.tar.gz gcc-7dc44f280e7d1126b4d05e79c53b40df1afe334a.tar.bz2 |
ada: Spurious error on nested call using the prefix notation
gcc/ada/
* exp_ch6.adb
(Build_Static_Check_Helper_Call): Perform implicit type conversion
to ensure matching types and avoid reporting spurious errors.
-rw-r--r-- | gcc/ada/exp_ch6.adb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb index 7555bf5..c026b63 100644 --- a/gcc/ada/exp_ch6.adb +++ b/gcc/ada/exp_ch6.adb @@ -7552,9 +7552,10 @@ package body Exp_Ch6 is Remove_Side_Effects (A); - if Is_Controlling_Actual (A) - and then Etype (F) /= Etype (A) - then + -- Ensure matching types to avoid reporting spurious errors since + -- the called helper may have been built for a parent type. + + if Etype (F) /= Etype (A) then Append_To (Actuals, Unchecked_Convert_To (Etype (F), New_Copy_Tree (A))); else |