public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Pierre-Marie de Rodat <pmderodat@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r12-1887] [Ada] More robust guard against cascaded errors with overlapping actuals
Date: Tue, 29 Jun 2021 14:25:36 +0000 (GMT)	[thread overview]
Message-ID: <20210629142536.08BBF388E813@sourceware.org> (raw)

https://gcc.gnu.org/g:3307a681fe6883008495d686f3b357dcbfb9537c

commit r12-1887-g3307a681fe6883008495d686f3b357dcbfb9537c
Author: Piotr Trojanek <trojanek@adacore.com>
Date:   Mon Apr 12 16:56:23 2021 +0200

    [Ada] More robust guard against cascaded errors with overlapping actuals
    
    gcc/ada/
    
            * sem_warn.adb (Warn_On_Overlapping_Actuals): Prevent cascaded
            errors once for the subprogram call, not for every pair of
            actual parameters.

Diff:
---
 gcc/ada/sem_warn.adb | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/gcc/ada/sem_warn.adb b/gcc/ada/sem_warn.adb
index 23f27711b5a..9e337f944de 100644
--- a/gcc/ada/sem_warn.adb
+++ b/gcc/ada/sem_warn.adb
@@ -3729,6 +3729,11 @@ package body Sem_Warn is
 
       if Nkind (N) not in N_Subprogram_Call | N_Entry_Call_Statement then
          return;
+
+      --  Guard against previous errors
+
+      elsif Error_Posted (N) then
+         return;
       end if;
 
       --  If a call C has two or more parameters of mode in out or out that are
@@ -3800,10 +3805,9 @@ package body Sem_Warn is
                   and then Is_Composite_Type (Etype (Form1)))
                then
 
-               --  Guard against previous errors
+                  --  Guard against previous errors
 
-                  if Error_Posted (N)
-                    or else No (Etype (Act1))
+                  if No (Etype (Act1))
                     or else No (Etype (Act2))
                   then
                      null;


                 reply	other threads:[~2021-06-29 14:25 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=20210629142536.08BBF388E813@sourceware.org \
    --to=pmderodat@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).