This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
asked for int, got unsigned int, in 980608
- To: egcs-bugs at cygnus dot com
- Subject: asked for int, got unsigned int, in 980608
- From: dcb at pncl dot co dot uk (David C Binderman)
- Date: Wed, 10 Jun 1998 20:56:31 +0100 (BST)
Hello there,
For the following code,
class B {
public:
operator int() { return 0; }
};
class D : public B {
public:
operator unsigned int() { return 1; }
};
int
main()
{
D d;
return int( d);
}
then egcs-980608 gets a return code of 1.
Other C++ compilers, including gcc 2.7.2.1, get a return code of 0.
Linux/i586, if that matters.
Regards
David Binderman MSc BSc +44 1293 534 847 dcb_AVOID_JUNK_MAIL@pncl.co.uk
There is no substitute for skill, taste and experience when programming
- Dr Stroustrup, inventor of C++