public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "redi 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: Tue, 05 Nov 2013 11:59:00 -0000 [thread overview] Message-ID: <bug-58993-4-GmjcnYFTIy@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-58993-4@http.gcc.gnu.org/bugzilla/> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58993 Jonathan Wakely <redi at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |accepts-invalid Status|UNCONFIRMED |NEW Last reconfirmed| |2013-11-05 Blocks| |59002 Summary|failure to access pointer |incorrectly accept access |to protected member method |of protected member method |in base from derived class |from derived class template |specialization | Ever confirmed|0 |1 --- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> --- Reduced test, where the base member is private, but the primary template can still access it class base { private: int foo() { } }; template <typename T> struct bar : public base { void test() { &base::foo; // should be rejected } }; template <> struct bar<void> : public base { void test() { // &base::foo; // correctly rejected } }; int main() { bar<int>().test(); bar<void>().test(); }
next prev parent reply other threads:[~2013-11-05 11:59 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 ` redi at gcc dot gnu.org [this message] 2013-11-05 13:37 ` [Bug c++/58993] incorrectly accept access of protected member method from derived class template 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 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-GmjcnYFTIy@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).