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: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 Mar 2007 04:40:56 -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 #4 from bangerth at dealii dot org 2007-03-09 04:40 -------
What exactly are you trying to achieve here:
-------------
typedef void (B::*FPTR)(int);
...
struct C : public A , public B {
virtual void C_bad() { }
};
c.t((FPTR)&C::C_bad);
------------------
Clearly, C::Cbad is a void function, but you assign it to a pointer to a
function that takes an int. That can't possibly work. Indeed, if you let
C_bad take an int, the segfault goes away.
W.
--
bangerth at dealii dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |bangerth at dealii dot org
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30975