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-2162] [Ada] Spurious style message on missing overriding indicator
Date: Thu,  8 Jul 2021 13:37:45 +0000 (GMT)	[thread overview]
Message-ID: <20210708133745.BAEBA398B883@sourceware.org> (raw)

https://gcc.gnu.org/g:99d6c1f8c29da41c33059024ff7494834b3bfbdc

commit r12-2162-g99d6c1f8c29da41c33059024ff7494834b3bfbdc
Author: Ed Schonberg <schonberg@adacore.com>
Date:   Sat May 29 10:14:46 2021 -0400

    [Ada] Spurious style message on missing overriding indicator
    
    gcc/ada/
    
            * style.adb (Missing_Overriding): Do not emit message when
            parent of subprogram is a full type declaration.

Diff:
---
 gcc/ada/style.adb | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gcc/ada/style.adb b/gcc/ada/style.adb
index 1409cc61d19..c2bff83c9c6 100644
--- a/gcc/ada/style.adb
+++ b/gcc/ada/style.adb
@@ -265,11 +265,15 @@ package body Style is
       --  indicators were introduced in Ada 2005. We apply Comes_From_Source
       --  to Original_Node to catch the case of a procedure body declared with
       --  "is null" that has been rewritten as a normal empty body.
+      --  We do not emit a warning on an inherited operation that comes from
+      --  a type derivation.
 
       if Style_Check_Missing_Overriding
         and then (Comes_From_Source (Original_Node (N))
                    or else Is_Generic_Instance (E))
         and then Ada_Version_Explicit >= Ada_2005
+        and then Present (Parent (E))
+        and then Nkind (Parent (E)) /= N_Full_Type_Declaration
       then
          --  If the subprogram is an instantiation,  its declaration appears
          --  within a wrapper package that precedes the instance node. Place


                 reply	other threads:[~2021-07-08 13:37 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=20210708133745.BAEBA398B883@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).