From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E58093857C6D; Tue, 8 Feb 2022 19:18:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E58093857C6D From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/104379] [9/10/11/12 Regression] -Wshadow warning given three times Date: Tue, 08 Feb 2022 19:18:22 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 11.2.1 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 9.5 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Feb 2022 19:18:23 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104379 --- Comment #8 from CVS Commits --- The master branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:71e6353e1b03021bc8bbcf4bd67a5f14d09b5fb1 commit r12-7113-g71e6353e1b03021bc8bbcf4bd67a5f14d09b5fb1 Author: Jakub Jelinek Date: Tue Feb 8 20:17:55 2022 +0100 c++: Don't emit repeated -Wshadow warnings for templates/ctors [PR10437= 9] The following patch suppresses extraneous -Wshadow warnings. On the testcase without the patch we emit 14 -Wshadow warnings, with the patch just 4. It is enough to warn once e.g. during parsing of the template or the abstract ctor, while previously we'd warn also on the clones of the ctors and on instantiation. In GCC 8 and earlier we didn't warn because check_local_shadow did /* Inline decls shadow nothing. */ if (DECL_FROM_INLINE (decl)) return; 2022-02-08 Jakub Jelinek PR c++/104379 * name-lookup.cc (check_local_shadow): When diagnosing shadowing of a member or global declaration, add warning suppression for the decl and don't warn again on it. * g++.dg/warn/Wshadow-18.C: New test.=