This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/22343] Override overloaded function problems
- From: "gadniomaina at yahoo dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 7 Jul 2005 11:42:09 -0000
- Subject: [Bug c++/22343] Override overloaded function problems
- References: <20050707100652.22343.gadniomaina@yahoo.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From gadniomaina at yahoo dot com 2005-07-07 11:42 -------
The compiler always gives an error when it cannot cast the parameter to the type
of the OVERLOADED function. for example, the code
class a
{
public:
virtual void bb( unsigned )
{
}
void bb( int )
{
}
};
class b: public a
{
public:
void bb( unsigned )
{
}
};
int main()
{
b bb;
bb.bb( -5 );
return 0;
}
compiles with a warning, but the code:
class a
{
public:
virtual void bb( unsigned )
{
}
void bb( pair< int, double> )
{
}
};
class b: public a
{
public:
void bb( unsigned )
{
}
};
int main()
{
b bb;
pair< int, double > t;
bb.bb( t );
return 0;
}
does NOT compile at all.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22343