From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id F005F38582A0; Fri, 26 Aug 2022 15:19:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F005F38582A0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1661527188; bh=HgV5S8WD8UV40SkHRkPH2LDGVovQsFsNHUgPsneRhyc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=xZRmRohbQD0TCAdioz1SDyGDPtfXXaXUDKIxAZ60aCU7YtfKpJ3UXguVdhBthavcZ Jr0lcNtqpzZZmq+oUeHhSXuhHnn0m2srFHysYtG4k7Lljvl/rvQFzmv2d9CKyuoN3l bWkaHcoUyfRkRCHsthAbIgUtG+qhp4fJJYJZIHHk= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/106756] Overbroad friendship for nested classes Date: Fri, 26 Aug 2022 15:19:47 +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 X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED 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: cc keywords 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=3D106756 Jonathan Wakely changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jason at gcc dot gnu.org Keywords| |accepts-invalid --- Comment #1 from Jonathan Wakely --- Started to be accepted with Jason's r13-465: c++: hidden friend access [DR1699] It has come up several times that Clang considers hidden friends of a c= lass to be sufficiently memberly to be covered by a friend declaration naming the class. This is somewhat unclear in the standard: [class.friend] says "Declaring a class to be a friend implies that private and protected members of the class granting friendship can be named in the base-specifiers and member declarations of the befriended class." A hidden friend is a syntactic member-declaration, but is it a "member declaration"? CWG was ambivalent, and referred the question to EWG as a design choice. But recently Patrick mentioned that the current G++ cho= ice not to treat it as a "member declaration" was making his library work significantly more cumbersome, so let's go ahead and vote the other way. This means that the testcases for 100502 and 58993 are now accepted. DR1699 PR c++/100502 PR c++/58993 gcc/cp/ChangeLog: * friend.cc (is_friend): Hidden friends count as members. * search.cc (friend_accessible_p): Likewise.=