handling of pointer to memberfunction

Dirk Bonekaemper db@rtsffm.com
Wed May 3 09:39:00 GMT 2000


Hi everybody,

for function overloading, a pointer to a memberfunctionpointer is
considered to be of the same type as a const pointer to a
memberfunctionpointer. (I know, too may pointers :-)

I found this weird behaviour when I tried to instantiate a stl vector
of pointers to memberfunctions. The error happened in the allocator
template.

The simple test program which I've attached shows the problem. 

Cheers,
	Dirk

----
Dirk Bonekamper                                 EMail   db@rtsffm.com
RTS Realtime Systems AG                         Phone   +49 (0) 69 61009 330
Rembrandtstr. 13                                Fax     +49 (0) 69 61009 181
D-60596 Frankfurt (Germany)

---------------------------------------------------------------------
> gcc -v --save-temps -c  bug.cxx
Reading specs from /opt/gnu/gcc-2.95.2/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/specs
gcc version 2.95.2 19991024 (release)
 /opt/gnu/gcc-2.95.2/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/cpp -lang-c++ -v -D__GNUC__=2 -D__GNUG__=2 -D__GNUC_MINOR__=95 -D__cplusplus -D__ELF__ -Dunix -D__i386__ -Dlinux -D__ELF__ -D__unix__ -D__i386__ -D__linux__ -D__unix -D__linux -Asystem(posix) -D__EXCEPTIONS -Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__ -Di686 -Dpentiumpro -D__i686 -D__i686__ -D__pentiumpro -D__pentiumpro__ bug.cxx bug.ii
GNU CPP version 2.95.2 19991024 (release) (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
 /opt/gnu/gcc-2.95.2/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/../../../../include/g++-3
 /usr/local/include
 /opt/gnu/gcc-2.95.2/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/../../../../i686-pc-linux-gnu/include
 /opt/gnu/gcc-2.95.2/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include
 /usr/include
End of search list.
The following default directories have been omitted from the search path:
End of omitted list.
 /opt/gnu/gcc-2.95.2/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/cc1plus bug.ii -quiet -dumpbase bug.cc -version -o bug.s
GNU C++ version 2.95.2 19991024 (release) (i686-pc-linux-gnu) compiled by GNU C version 2.95.2 19991024 (release).
bug.cxx: In function `void f(void (C::* *)())':
bug.cxx:9: redefinition of `void f(void (C::* *)())'
bug.cxx:6: `void f(void (C::* *)())' previously defined here




More information about the Gcc-bugs mailing list