From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7871) id 45DB73848E19; Tue, 6 Dec 2022 14:01:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 45DB73848E19 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1670335290; bh=Q8ZZhvZoJxJEOye++RaV2sfbaOM+18PPl7IAAkuDyDc=; h=From:To:Subject:Date:From; b=G4gzjzZi7v2FT1DbIm4BzV5iU/7t2BHOaeLg6t40URdBk2adM2kyBt+LaA4Zinh/r YrAMHKGZEEScQ+sCk0gySGu3RgeE2eIs0K6B3ciTHobtJ6vXpkRc6UhngVMSbt//uw xR72Cy5ZNcNfa8mM956QC9amRsEJQ/PmYXFo/LX4= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Marc Poulhi?s To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-4514] ada: Spurious error on nested call using the prefix notation X-Act-Checkin: gcc X-Git-Author: Javier Miranda X-Git-Refname: refs/heads/master X-Git-Oldrev: 188965afb10a2bf14527f2aa9f9cb0f8fcc991e9 X-Git-Newrev: 7dc44f280e7d1126b4d05e79c53b40df1afe334a Message-Id: <20221206140130.45DB73848E19@sourceware.org> Date: Tue, 6 Dec 2022 14:01:30 +0000 (GMT) List-Id: https://gcc.gnu.org/g:7dc44f280e7d1126b4d05e79c53b40df1afe334a commit r13-4514-g7dc44f280e7d1126b4d05e79c53b40df1afe334a Author: Javier Miranda Date: Sat Nov 19 19:46:31 2022 +0000 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. Diff: --- gcc/ada/exp_ch6.adb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb index 7555bf5dcf5..c026b63fcf6 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