From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id ED4EF3858D32; Tue, 26 Jul 2022 12:04:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ED4EF3858D32 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/106311] [12/13 Regression] internal compiler error in redeclare_class_template Date: Tue, 26 Jul 2022 12:04:53 +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: 12.0 X-Bugzilla-Keywords: ice-on-invalid-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: 12.2 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, 26 Jul 2022 12:04:54 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106311 --- Comment #2 from CVS Commits --- The trunk branch has been updated by Marek Polacek : https://gcc.gnu.org/g:2333b58c9892667545d0c2c3ecd2d7b947197511 commit r13-1841-g2333b58c9892667545d0c2c3ecd2d7b947197511 Author: Marek Polacek Date: Fri Jul 15 09:51:50 2022 -0400 c++: ICE with erroneous template redeclaration [PR106311] Here we ICE trying to get DECL_SOURCE_LOCATION of the parm that happens to be error_mark_node in this ill-formed test. I kept running into this while reducing code, so it'd be good to have it fixed. PR c++/106311 gcc/cp/ChangeLog: * pt.cc (redeclare_class_template): Check DECL_P before accessi= ng DECL_SOURCE_LOCATION. gcc/testsuite/ChangeLog: * g++.dg/template/redecl5.C: New test.=