From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1914) id 492D9385142A; Fri, 13 May 2022 08:09:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 492D9385142A MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Pierre-Marie de Rodat To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-412] [Ada] Fix incorrect call to inherited function with limited return type X-Act-Checkin: gcc X-Git-Author: Eric Botcazou X-Git-Refname: refs/heads/master X-Git-Oldrev: ba75fee24d91eb241b5784a8a55175c294b040ab X-Git-Newrev: c77e4873b14bd84fc6715db8980ce14886b28906 Message-Id: <20220513080943.492D9385142A@sourceware.org> Date: Fri, 13 May 2022 08:09:43 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 May 2022 08:09:43 -0000 https://gcc.gnu.org/g:c77e4873b14bd84fc6715db8980ce14886b28906 commit r13-412-gc77e4873b14bd84fc6715db8980ce14886b28906 Author: Eric Botcazou Date: Sat Mar 5 19:18:18 2022 +0100 [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. Diff: --- gcc/ada/sem_ch3.adb | 1 + 1 file changed, 1 insertion(+) diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index b81216c9f29..054648b34f4 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