From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9C3EA3848030; Fri, 9 Apr 2021 22:38:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9C3EA3848030 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/99120] [8/9/10 Regression] ICE in -Wshadow in templated member function Date: Fri, 09 Apr 2021 22:38:09 +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.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: mpolacek at gcc dot gnu.org X-Bugzilla-Target-Milestone: 8.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: Fri, 09 Apr 2021 22:38:09 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99120 --- Comment #4 from CVS Commits --- The releases/gcc-10 branch has been updated by Marek Polacek : https://gcc.gnu.org/g:c7d7c15540d5173f76b570bd457e866f09a17722 commit r10-9686-gc7d7c15540d5173f76b570bd457e866f09a17722 Author: Marek Polacek Date: Fri Mar 5 10:41:41 2021 -0500 c++: ICE with -Wshadow and enumerator in template [PR99120] We crash here, because in a template, an enumerator doesn't have a type until we've called finish_enum_value_list. But our -Wshadow implementation, check_local_shadow, is called when we pushdecl in build_enumerator, which takes place before finish_enum_value_list. gcc/cp/ChangeLog: PR c++/99120 * name-lookup.c (check_local_shadow): Check if the type of decl is non-null before checking TYPE_PTR*. gcc/testsuite/ChangeLog: PR c++/99120 * g++.dg/warn/Wshadow-17.C: New test. (cherry picked from commit c2e64c33d9d903f0a52565ad98300feea0ffc580)=