This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Overloaded m/fs
- To: egcs-bugs at cygnus dot com
- Subject: Overloaded m/fs
- From: "M.Reed" <M dot Reed at rd4-nats dot demon dot co dot uk>
- Date: Thu, 11 Feb 1999 11:10:20 +0000
Hi,
Not being an ANSI C++ guru I'm not sure if this is a bug or not.
Suffice to say it was OK with gcc-2.8.1
The following code:
void func( void (*)( int ) ) {
}
class A
{
public:
A( void ) {
func( &mf );
}
private:
static void mf( int );
void mf( char );
};
When compiled with:
gcc -c -Wall ol.cxx
gave:
ol.cxx: In method `A::A()':
ol.cxx:9: warning: converting from `void (A::*)(char)' to `void
(*)(int)'
It looks like an error to me since clearly there is a m/f that matches
exactly and it is not being used.
Hope this is useful. Take care.
Mike.
OSF1 verdi V4.0 564 alpha
egcs configured with
--prefix=/usr/xlocal --with-gnu-as
config.guess gave:
alpha-dec-osf4.0b
stage1 built with gcc 2.8.1
gcc -v gave:
gcc version egcs-2.91.57 19980901 (egcs-1.1 release)
The opinions expressed here are personal and do not necessarily
reflect the opinions of NATS or the opinions of my colleagues.
Mike Reed Tel: +44 (0) 171 832 5211
NATS Ltd Fax: +44 (0) 171 832 5658
CAA House, K4G5 e-mail: M.Reed@rd4-nats.demon.co.uk
45-59 Kingsway
London WC2B 6TE
United Kingdom