public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Marc Poulhi?s <dkm@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r13-4514] ada: Spurious error on nested call using the prefix notation
Date: Tue,  6 Dec 2022 14:01:30 +0000 (GMT)	[thread overview]
Message-ID: <20221206140130.45DB73848E19@sourceware.org> (raw)

https://gcc.gnu.org/g:7dc44f280e7d1126b4d05e79c53b40df1afe334a

commit r13-4514-g7dc44f280e7d1126b4d05e79c53b40df1afe334a
Author: Javier Miranda <miranda@adacore.com>
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

                 reply	other threads:[~2022-12-06 14:01 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221206140130.45DB73848E19@sourceware.org \
    --to=dkm@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).