This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: none
- To: hanwen at cs dot uu dot nl
- Subject: Re: none
- From: Alexandre Oliva <oliva at dcc dot unicamp dot br>
- Date: 17 Sep 1998 14:50:51 +-300
- Cc: egcs-bugs at cygnus dot com
- References: <19980917121941.2F7217CE83@mail.cs.uu.nl>
Han-Wen Nienhuys <hanwen@cs.uu.nl> writes:
> class Graphics; typedef void (Graphics::*Meth_ptr) (int,int);
> struct Graphics { Meth_ptr SwitchMode; };
> void bla() { Graphics g; g.SwitchMode (1,1); }
> (egcs-1.0.2 release).
> foo.cc:12: Internal compiler error.
> foo.cc:12: Please submit a full bug report to `egcs-bugs@cygnus.com'.
egcs 1.1 says:
/home/msc/oliva/test.cc: In function `void bla()':
/home/msc/oliva/test.cc:12: pointer-to-member function g.Graphics::SwitchMode cannot be called
/home/msc/oliva/test.cc:12: without an object; consider using .* or ->*
Rewriting:
void bla() { Graphics g; (g.*g.SwitchMode)(1,1); }
Results in correct compilation.
--
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil