From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 17D693858281; Tue, 4 Apr 2023 03:23:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 17D693858281 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1680578605; bh=EybUR9Yr7mKlfn4PUee5ivy82yrEZkRAfJYqUQaL76I=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Y+dxF122Bbaa8vXkKFfVNS7WDD8diDUwB/tyh2aJr6MZoz7Ep957iwYTxb0YfOyFa EQj1/QdmyCrPqdbUcg7IWLyyx81WI5wMMsDNPwTAaYlnRwuAItUykFpt7/3NnZliXi YV3elOcCVWC3f+otL8Xrc06tUX4yL4oCvlu/1UnA= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/107484] [13 Regression] ICE: Segmentation fault (in decls_match) Date: Tue, 04 Apr 2023 03:23:24 +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: 13.0 X-Bugzilla-Keywords: accepts-invalid, 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: P1 X-Bugzilla-Assigned-To: jason at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.0 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107484 --- Comment #3 from CVS Commits --- The trunk branch has been updated by Jason Merrill : https://gcc.gnu.org/g:0dfbb28a9549c2503204b0338bf550f1bff9c681 commit r13-6992-g0dfbb28a9549c2503204b0338bf550f1bff9c681 Author: Jason Merrill Date: Mon Apr 3 18:23:58 2023 -0400 c++: friend template matching [PR107484] Here friend matching tries to find a matching non-template friend and fails, so we mark the friend as a template specialization to be determined lat= er. Then cplus_decl_attributes tries again to find a matching function and = gets confused by DECL_TEMPLATE_INSTANTIATION without DECL_TEMPLATE_INFO. Bu= t it doesn't make sense for find_last_decl to be trying to match anything wi= th DECL_USE_TEMPLATE set; those are matched elsewhere. PR c++/107484 gcc/cp/ChangeLog: * decl2.cc (find_last_decl): Return early if DECL_USE_TEMPLATE. gcc/testsuite/ChangeLog: * g++.dg/lookup/friend25.C: New test.=