[Bug c++/30975] ptr to member func __delta is 0 if ptr declaration does not match function porototype

pinskia at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Mon Feb 26 22:56:00 GMT 2007



------- 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



More information about the Gcc-bugs mailing list