Possible member-function bug with egcs19990328
Jeroen Dobbelaere
Jeroen.Dobbelaere@tvd.be
Sun Mar 28 06:32:00 GMT 1999
Hi,
Following program
//---- begin
struct A
{
typedef void (A::*aFn)(int, bool);
A() {}
~A() {}
void f1(int, bool) { }
void f(A& obj, aFn theFn) { (obj.*theFn)(1,true); }
};
typedef void (*aFn2)(int, bool);
void gf1(int, bool) {}
void gf(aFn2 theFn) { theFn(1,true); }
int main()
{
A a;
gf(gf1); //ok
gf(&gf1); //ok
a.f(a, A::f1); //nok line 24
a.f(a, &A::f1); //ok
return 0;
}
//---- end
produces :
$ g++ -Wall test.cpp
test.cpp: In function `int main()':
test.cpp:24: no matching function for call to `A::f (A &, void
(A::)(int, bool))'
test.cpp:10: candidates are: void A::f(A &, void (A::*)(int, bool))
I think that g++ should also accept line 24.
$ g++ -v
Reading specs from
/ap/egcs/cvs/lib/gcc-lib/i586-pc-linux-gnu/egcs-2.93.14/specs
gcc version egcs-2.93.14 19990328 (gcc2 ss-980929 experimental)
More information about the Gcc-bugs
mailing list