From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6729C3858C55; Mon, 11 Apr 2022 17:22:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6729C3858C55 From: "ppalka at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/105223] [12 Regression] filter_memfn_lookup internal compiler error Date: Mon, 11 Apr 2022 17:22:16 +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-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: ppalka at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.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 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: Mon, 11 Apr 2022 17:22:16 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105223 --- Comment #2 from Patrick Palka --- The implicitly declared ServiceReference::operator=3D members lack a TEMPLATE_INFO, but filter_memfn_lookup expects it (along with all other non-template member functions from the instantiated class) to have one. Not sure what the best solution here is, but we can at least work around th= is by making filter_memfn_lookup tolerate missing TEMPLATE_INFO in this case: gcc/cp/pt.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gcc/cp/pt.cc b/gcc/cp/pt.cc index 78519562953..f359e596846 100644 --- a/gcc/cp/pt.cc +++ b/gcc/cp/pt.cc @@ -16404,6 +16404,13 @@ filter_memfn_lookup (tree oldfns, tree newfns, tree newtype) look in the old lookup set for the TEMPLATE_DECL from which it was specialized. */ return visible_set.contains (DECL_TI_TEMPLATE (fn)); + else if (!DECL_TEMPLATE_INFO (fn)) + { + /* FN is an implicitly declared special member function and thus + could not have been in the old lookup set. */ + gcc_checking_assert (DECL_ARTIFICIAL (fn) && DECL_DEFAULTED_FN (fn)= ); + return false; + } else /* FN is a non-template member function from the current class; look in the old lookup set for the FUNCTION_DECL from which=