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-1584] [Ada] Fix handling of generic types in check for overlapping actuals
Date: Thu, 17 Jun 2021 14:34:10 +0000 (GMT)	[thread overview]
Message-ID: <20210617143410.5D01E396AC1F@sourceware.org> (raw)

https://gcc.gnu.org/g:679124db5bc81cca40d33543916cd82981601f06

commit r12-1584-g679124db5bc81cca40d33543916cd82981601f06
Author: Piotr Trojanek <trojanek@adacore.com>
Date:   Wed Mar 10 10:38:57 2021 +0100

    [Ada] Fix handling of generic types in check for overlapping actuals
    
    gcc/ada/
    
            * sem_warn.adb (Warn_On_Overlapping_Actuals): Ignore formal of
            generic types, but keep examining other parameters.

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

diff --git a/gcc/ada/sem_warn.adb b/gcc/ada/sem_warn.adb
index 1e62d478022..6db6d2ccfbe 100644
--- a/gcc/ada/sem_warn.adb
+++ b/gcc/ada/sem_warn.adb
@@ -3741,17 +3741,20 @@ package body Sem_Warn is
       Form1 := First_Formal (Subp);
       Act1  := First_Actual (N);
       while Present (Form1) and then Present (Act1) loop
-         if Is_Generic_Type (Etype (Act1)) then
-            return;
-         end if;
 
          Form2 := Next_Formal (Form1);
          Act2  := Next_Actual (Act1);
          while Present (Form2) and then Present (Act2) loop
-            if Refer_Same_Object (Act1, Act2) then
-               if Is_Generic_Type (Etype (Act2)) then
-                  return;
-               end if;
+
+            --  Ignore formals of generic types; they will be examined when
+            --  instantiated.
+
+            if Is_Generic_Type (Etype (Form1))
+              or else Is_Generic_Type (Etype (Form2))
+            then
+               null;
+
+            elsif Refer_Same_Object (Act1, Act2) then
 
                --  Case 1: two writable elementary parameters that overlap


                 reply	other threads:[~2021-06-17 14:34 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=20210617143410.5D01E396AC1F@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).