public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/58993] incorrectly accept access of protected member method from derived class template Date: Sun, 15 May 2022 16:45:14 +0000 [thread overview] Message-ID: <bug-58993-4-FKicJmkRa8@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-58993-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58993 --- Comment #11 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jason Merrill <jason@gcc.gnu.org>: https://gcc.gnu.org/g:4df735e01e319997841574f353d2aa076a0335c2 commit r13-465-g4df735e01e319997841574f353d2aa076a0335c2 Author: Jason Merrill <jason@redhat.com> Date: Fri Mar 18 22:52:32 2022 -0400 c++: hidden friend access [DR1699] It has come up several times that Clang considers hidden friends of a class 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++ choice 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. gcc/testsuite/ChangeLog: * g++.dg/template/access37.C: Now OK. * g++.dg/template/friend69.C: Now OK. * g++.dg/lookup/friend23.C: New test.
next prev parent reply other threads:[~2022-05-15 16:45 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2013-11-04 23:52 [Bug c++/58993] New: failure to access pointer to protected member method in base from derived class specialization cvs at cs dot utoronto.ca 2013-11-05 11:59 ` [Bug c++/58993] incorrectly accept access of protected member method from derived class template redi at gcc dot gnu.org 2013-11-05 13:37 ` cvs at cs dot utoronto.ca 2021-01-12 16:58 ` ppalka at gcc dot gnu.org 2021-01-19 21:20 ` cvs-commit at gcc dot gnu.org 2021-01-20 14:52 ` ppalka at gcc dot gnu.org 2022-05-15 16:45 ` cvs-commit at gcc dot gnu.org [this message] 2022-06-02 13:29 ` ppalka at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-58993-4-FKicJmkRa8@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).