From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 36704385AC19; Fri, 18 Feb 2022 01:22:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 36704385AC19 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/94944] compile error accessing member function of dependent base class template in noexcept specification Date: Fri, 18 Feb 2022 01:22:51 +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: 10.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: ppalka at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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, 18 Feb 2022 01:22:51 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94944 --- Comment #5 from CVS Commits --- The master branch has been updated by Patrick Palka : https://gcc.gnu.org/g:36278f48cbc08c78e4ed588e5a049bd45fd1c55a commit r12-7291-g36278f48cbc08c78e4ed588e5a049bd45fd1c55a Author: Patrick Palka Date: Thu Feb 17 20:20:24 2022 -0500 c++: implicit 'this' in noexcept-spec within class tmpl [PR94944] Here when instantiating the noexcept-spec we fail to resolve the implicit object for the member call A::f() ultimately because maybe_instantiate_noexcept sets current_class_ptr/ref to the dependent 'this' (of type B) rather than the specialized 'this' (of type B). This patch fixes this by making maybe_instantiate_noexcept set current_class_ptr/ref to the specialized 'this' instead, consistent with what tsubst_function_type does when substituting into the trailing return type of a non-static member function. PR c++/94944 gcc/cp/ChangeLog: * pt.cc (maybe_instantiate_noexcept): For non-static member functions, set current_class_ptr/ref to the specialized 'this' instead. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/noexcept34.C: Adjusted expected diagnostics. * g++.dg/cpp0x/noexcept75.C: New test.=