public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "paulhaile3 at gmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/111531] Bound member function with multiple inheritance documentation should be clearer Date: Fri, 22 Sep 2023 12:16:45 +0000 [thread overview] Message-ID: <bug-111531-4-Dzgwanvvf0@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-111531-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111531 --- Comment #3 from Paul Haile <paulhaile3 at gmail dot com> --- Fair enough definitely could be intentional. However, In this example renaming typedef void (*b_fptr)(B *); to typedef void (*b_fptr)(A *); gets rid of the error. It seems restricting the binding such that the object must be the same type as the class of the member function would solve this. Is there any reason to allowing the object be any type? E.g. it seems like this also compiles where the object is a completely different type -------- struct A { void f() { } }; struct C {}; typedef void (*c_fptr)(C *); int main() { C c; c_fptr fp = (c_fptr)(&A::f); fp(&c); } --------
next prev parent reply other threads:[~2023-09-22 12:16 UTC|newest] Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-09-22 0:30 [Bug c++/111531] New: Bound member function (-Wno-pmf-conversions) with multiple inheritance paulhaile3 at gmail dot com 2023-09-22 0:47 ` [Bug c++/111531] " pinskia at gcc dot gnu.org 2023-09-22 1:12 ` [Bug c++/111531] Bound member function with multiple inheritance documentation should be clearer pinskia at gcc dot gnu.org 2023-09-22 12:16 ` paulhaile3 at gmail dot com [this message] 2023-09-22 15:47 ` paulhaile3 at gmail dot com
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-111531-4-Dzgwanvvf0@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).