This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
static/member overloading bug still lives
- To: egcs-bugs at cygnus dot com
- Subject: static/member overloading bug still lives
- From: Martin Dorey <MDorey at madge dot com>
- Date: Thu, 15 Oct 1998 11:55:44 +0100
- Reply-To: martin dot dorey at madge dot com
To atone for my idiocy yesterday, here's the third (?) report of this bug,
introduced between 1.0.3 and 1.1. My excuse for re-reporting is that I've
tried it with the latest CVS sources and it produces the same warning. I've
checked the assembler produced and the message is correct - the wrong code
has
been generated.
//
// Demonstrates a problem with overloading of static and member functions,
// where egcs-1.1 and later has behaviour which incorrectly depends
// on the order of declaration.
//
void Call (int (*) (long))
{}
struct X
{
static int f (long);
int f (int);
int g (int);
static int g (long);
void monk ();
};
void
X::monk ()
{
Call (&g); // OK.
Call (&X::g); // OK.
Call (&X::f); // OK.
Call (&f); // Error.
}
$ /home/martindo/download/egcs/latest/bin/gcc -v --save-temps -x c++ -c
static member address
Reading specs from
/home/martindo/download/egcs/latest/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.92.
15/specs
gcc version egcs-2.92.15 19981014 (gcc2 ss-980609 experimental)
/home/martindo/download/egcs/latest/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.92.
15/cpp -lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus
-D__GNUC_MINOR__=92 -D__ELF__ -Dunix -Dlinux -D__ELF__ -D__unix__
-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__ static member address static
member address.ii
GNU CPP version egcs-2.92.15 19981014 (gcc2 ss-980609 experimental) (i386
Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
/home/martindo/download/egcs/latest/include/g++-2
/home/martindo/download/egcs/latest/include
/home/martindo/download/egcs/latest/i686-pc-linux-gnu/include
/home/martindo/download/egcs/latest/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.92.
15/include
/usr/include
End of search list.
/home/martindo/download/egcs/latest/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.92.
15/cc1plus static member address.ii -quiet -dumpbase static member
address.cc -version -o static member address.s
GNU C++ version egcs-2.92.15 19981014 (gcc2 ss-980609 experimental)
(i686-pc-linux-gnu) compiled by GNU C version 2.7.2.3.
static member address: In method `void X::monk()':
static member address:32: warning: converting from `int (X::*)(int)' to `int
(*)(long int)'
as -V -Qy -o static member address.o static member address.s
GNU assembler version 2.9.1 (i486-linux), using BFD version 2.9.1
--