This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
is this a g++ bug or an obscure ISO rule?
- From: Josh Fryman <fryman at cc dot gatech dot edu>
- To: gcc at gcc dot gnu dot org
- Date: Thu, 30 Oct 2003 15:32:36 -0500
- Subject: is this a g++ bug or an obscure ISO rule?
if i use the code as follows, everything is fine. if i replace the
"int x" with "void * x" (and cast appropriately), i get compiler
errors. i don't see in Stroustrup, 3rd ed, where this is an error
with "void *".
what am i missing? this is g++ 3.1.1 on sun-sparc-solaris2.8.
void
foo::foo_method( void )
{
int x;
void (foo::*ptr)(void) = &foo::foo_method;
x = (int)(this->*ptr);
cout << "foo::foo_method lives at addr " << (int*)x << endl;
}
thanks,
josh fryman