From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 390AE3857701; Wed, 26 Apr 2023 21:16:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 390AE3857701 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1682543794; bh=bvKwlVggJWBSw7jEi/0An8j8zL1wBCFox3dkvONUaw8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=i08hkc85es0IO/qBXpwmVhF1/4SYRrxS8NUoXTWPOTOVd1rKEV7mS2MEOmmENsi7v p/r0PkOaqtCUQULeR+lgGvF8PpNJ0HG1RXrnLF6KatJ3QVAlL+C31H09CKFpedT6f+ qSnCniuswJU9zrwVPBAbmTcgL+vLgr91t27k+ULE= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/69836] compilation error with constexpr in template types with redeclared methods Date: Wed, 26 Apr 2023 21:16:32 +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: unknown X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D69836 --- Comment #6 from CVS Commits --- The trunk branch has been updated by Jason Merrill : https://gcc.gnu.org/g:1e27e7e0985e055b3d4ec92e93976b709fdbe425 commit r14-277-g1e27e7e0985e055b3d4ec92e93976b709fdbe425 Author: Jason Merrill Date: Wed Feb 1 17:00:48 2023 -0500 c++: unique friend shenanigans [PR69836] Normally we re-instantiate a function declaration when we start to instantiate the body in case of multiple declarations. In this wacky testcase, this causes a problem because the type of the w_counter param= eter depends on its declaration not being in scope yet, so the name lookup o= nly finds the previous declaration. This isn't a problem for member functi= ons, since they aren't subject to argument-dependent lookup. So let's just = skip the regeneration for hidden friends. PR c++/69836 gcc/cp/ChangeLog: * pt.cc (regenerate_decl_from_template): Skip unique friends. gcc/testsuite/ChangeLog: * g++.dg/template/friend76.C: New test.=