mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-21 00:21:03 +08:00
[Ada] Mimic the C++ ABI when passing class-wide conversion actuals
This patch does not affect the behavior of Ada-only code but improves consistency with the code generated by the C++ compiler. 2018-09-26 Javier Miranda <miranda@adacore.com> gcc/ada/ * sem_res.adb (Resolve_Actuals): If the formal is a class-wide type conversion then do not skip resolving and expanding the conversion; required to displace the pointer to the object and reference the dispatch table associated with the target interface type. From-SVN: r264624
This commit is contained in:
parent
4f95defaa9
commit
c886a94613
@ -1,3 +1,11 @@
|
||||
2018-09-26 Javier Miranda <miranda@adacore.com>
|
||||
|
||||
* sem_res.adb (Resolve_Actuals): If the formal is a class-wide
|
||||
type conversion then do not skip resolving and expanding the
|
||||
conversion; required to displace the pointer to the object and
|
||||
reference the dispatch table associated with the target
|
||||
interface type.
|
||||
|
||||
2018-09-26 Hristian Kirtchev <kirtchev@adacore.com>
|
||||
|
||||
* libgnat/g-dynhta.adb (Prepend_Or_Replace): Update the number
|
||||
|
@ -3809,6 +3809,7 @@ package body Sem_Res is
|
||||
if Ekind (F) /= E_In_Parameter
|
||||
and then Nkind (A) = N_Type_Conversion
|
||||
and then not Is_Class_Wide_Type (Etype (Expression (A)))
|
||||
and then not Is_Interface (Etype (A))
|
||||
then
|
||||
if Ekind (F) = E_In_Out_Parameter
|
||||
and then Is_Array_Type (Etype (F))
|
||||
|
Loading…
x
Reference in New Issue
Block a user