This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Internal compiler error 40: pointer to member function syntax
- To: Phil Austin <phil at geog dot ubc dot ca>
- Subject: Re: Internal compiler error 40: pointer to member function syntax
- From: Alexandre Oliva <oliva at dcc dot unicamp dot br>
- Date: 08 Jan 1998 18:20:44 -0200
- Cc: egcs-bugs at cygnus dot com, <gorniau at unixg dot ubc dot ca>, duty at physics dot ubc dot ca
- References: <199801081838.KAA01783@curlew.geog.ubc.ca>
Phil Austin writes:
> gcc version egcs-2.90.21 971202 (egcs-1.00 release)
FYI, the error remains in egcs-1.0.1 :-(
> I would also be grateful if someone could
> tip me to the correct syntax to invoke a member function via a pointer
> to member function.
> useMethod(y,ts,dt);
> works in g++ 2.7.2.2 but not with egcs.
The correct syntax is: this->*useMethod(y,ts,dt);
Furthermore, you must write &ODEsolver::midpointODE, instead of
ODEsolver::midpointODE (note the & operator; it is not optional for
non-static member functions as it is for non-member functions)
--
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil