diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2022-03-05 19:18:18 +0100 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2022-05-13 08:04:47 +0000 |
commit | c77e4873b14bd84fc6715db8980ce14886b28906 (patch) | |
tree | 65fdb5f5c750c0b5e539b80f871fe2c89d22b8cb /gcc | |
parent | ba75fee24d91eb241b5784a8a55175c294b040ab (diff) | |
download | gcc-c77e4873b14bd84fc6715db8980ce14886b28906.zip gcc-c77e4873b14bd84fc6715db8980ce14886b28906.tar.gz gcc-c77e4873b14bd84fc6715db8980ce14886b28906.tar.bz2 |
[Ada] Fix incorrect call to inherited function with limited return type
This is a return convention mismatch coming from a discrepancy of the
Returns_By_Ref flag for the inherited function.
gcc/ada/
* sem_ch3.adb (Derive_Subprogram): For a function, also copy the
Returns_By_Ref flag from the parent.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/sem_ch3.adb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index b81216c..054648b 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -16333,6 +16333,7 @@ package body Sem_Ch3 is if Ekind (New_Subp) = E_Function then Set_Mechanism (New_Subp, Mechanism (Parent_Subp)); + Set_Returns_By_Ref (New_Subp, Returns_By_Ref (Parent_Subp)); end if; -- Ada 2022 (AI12-0279): If a Yield aspect is specified True for a |