This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
overloaded member bug
- To: egcs-bugs at cygnus dot com
- Subject: overloaded member bug
- From: Bill Currie <bcurrie at tssc dot co dot nz>
- Date: Fri, 28 Aug 1998 09:24:58 +1200
- Organization: Telecommunication Systems Support Centre
I've submitted this bug a couple of times previously, but I only got one
message saying that it looked like a bug (can't remeber who it was.
Mike, maybe???). I guess this is more me asking if this is in the queue
and is it expected to be fixed for 1.1 (easy workaround, but it's
anoying).
$ gcc -v oload-bug.cc
Reading specs from
/home/users/bcurrie/lib/gcc-lib/hppa1.1-stratus-sysv4/egcs-2.91.55/specs
gcc version egcs-2.91.55 19980826 (gcc2 ss-980609 experimental)
/home/users/bcurrie/lib/gcc-lib/hppa1.1-stratus-sysv4/egcs-2.91.55/cpp
-lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus
-D__GNUC_MINOR__=91 -Dhppa -Dunix -D_FTX -D__hppa__ -D__unix__ -D_FTX
-D__hppa -D__unix -Asystem(unix) -Acpu(hppa) -Amachine(hppa)
-D__EXCEPTIONS -D_PA_RISC1_1 oload-bug.cc /var/tmp/ccDxRtSH.ii
GNU CPP version egcs-2.91.55 19980826 (gcc2 ss-980609 experimental)
(hppa)
#include "..." search starts here:
#include <...> search starts here:
/home/users/bcurrie/include/g++
/usr/local/include
/home/users/bcurrie/hppa1.1-stratus-sysv4/include
/home/users/bcurrie/lib/gcc-lib/hppa1.1-stratus-sysv4/egcs-2.91.55/include
/usr/include
End of search list.
/home/users/bcurrie/lib/gcc-lib/hppa1.1-stratus-sysv4/egcs-2.91.55/cc1plus
/var/tmp/ccDxRtSH.ii -quiet -dumpbase oload-bug.cc -version -o
/var/tmp/ccS9vmkq.s
GNU C++ version egcs-2.91.55 19980826 (gcc2 ss-980609 experimental)
(hppa1.1-stratus-sysv4) compiled by GNU C version egcs-2.91.53 19980809
(gcc2 ss-980609 experimental).
oload-bug.cc: In method `foobar::foobar()':
oload-bug.cc:23: no matching function for call to `func (void
(foobar::)(), foobar *)'
oload-bug.cc:1: candidates are: func(void (*)(void *, void *), void *)
oload-bug.cc:2: func(void (*)(void *), void *)
oload-bug.cc:24: warning: assuming & on `foobar::callback()'
oload-bug.cc:24: warning: converting from `void (foobar::*)()' to `void
(*)(void *)'
$ cat oload-bug.cc
void func(void (*)(void *, void *), void *);
void func(void (*)(void *), void *);
void foo(void (*)(void *), void *);
class foobar {
// reverse the following functions, and the warnings and errors go
away,
// producing correct code
static void callback(void *);
void callback();
public:
foobar();
};
void foobar::callback()
{
}
void foobar::callback(void *obj)
{
((foobar*)obj)->callback();
}
foobar::foobar()
{
func(callback,this);
foo(callback,this);
}
Bill
--
Leave others their otherness