This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/30975] ptr to member func __delta is 0 if ptr declaration does not match function porototype
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 26 Feb 2007 22:56:09 -0000
- Subject: [Bug c++/30975] ptr to member func __delta is 0 if ptr declaration does not match function porototype
- References: <bug-30975-14163@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from pinskia at gcc dot gnu dot org 2007-02-26 22:56 -------
Well this is undefined code really. You are calling the function via the wrong
type.
If you do:
c.t((FPTR)(FPTR1)&C::C_bad);
And use it as a FPTR1, it works.
FPTR1 is defined as:
typedef void (B::*FPTR1)();
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30975