This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Internal compiler error 40: pointer to member function syntax


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]