Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!mips!apple!bionet!agate!saturn!saturn.ucsc.edu!daniel From: daniel@vega.ucsc.edu Newsgroups: comp.lang.c++ Subject: Addr overloaded member fcn on operator Keywords: apparent cfront bug Message-ID: <10784@saturn.ucsc.edu> Date: 16 Feb 90 22:38:22 GMT Sender: usenet@saturn.ucsc.edu Reply-To: daniel@cis.ucsc.edu () Organization: University of California, Santa Cruz Lines: 42 /* Does section 13.3 of Stroustrup's (2.0) reference on taking the address of an overloaded function apply to member functions as well as globals. If so, this should be valid. Apparently cfront fails to correctly select the overload function. Can someone find an error in this code? If not, is this a known cfront bug? The bug apparently manifests itself even if only one overloaded addition operator is supplied. It also manifests itself in the case of taking an overloaded function's address by using it as a function parameter. */ struct S { int func(int) { return 1; } int func(void*) { return 2; } } s; struct A {} a; struct B {} b; int operator+(A, int (S::*)(int)) { return 1; } int operator+(B, int (S::*)(void*)) { return 2; } main() { int i; i = a + S::func; // Bad argument error from cfront i = b + S::func; // Bad argument error from cfront } /* Daniel Edelson daniel@cis.ucsc.edu */