none

Alexandre Oliva oliva@dcc.unicamp.br
Thu Sep 17 12:48:00 GMT 1998


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




More information about the Gcc-bugs mailing list