From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1914) id BAEBA398B883; Thu, 8 Jul 2021 13:37:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BAEBA398B883 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Pierre-Marie de Rodat To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-2162] [Ada] Spurious style message on missing overriding indicator X-Act-Checkin: gcc X-Git-Author: Ed Schonberg X-Git-Refname: refs/heads/master X-Git-Oldrev: 3c18e32037a4ab02afd22a535a96ac4cc3f88b16 X-Git-Newrev: 99d6c1f8c29da41c33059024ff7494834b3bfbdc Message-Id: <20210708133745.BAEBA398B883@sourceware.org> Date: Thu, 8 Jul 2021 13:37:45 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2021 13:37:45 -0000 https://gcc.gnu.org/g:99d6c1f8c29da41c33059024ff7494834b3bfbdc commit r12-2162-g99d6c1f8c29da41c33059024ff7494834b3bfbdc Author: Ed Schonberg 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