This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: g++; operator==
- From: Richard Guenther <rguenther at suse dot de>
- To: Markus Bina <aon dot 912473424 at aon dot at>
- Cc: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 30 Aug 2005 10:09:06 +0200 (CEST)
- Subject: Re: g++; operator==
First of all, this mailinglist only tracks bugzilla
(http://gcc.gnu.org/bugzilla) activity, so getting help
this way is going to fail.
Second, your testcase is invalid C++, to fix it, change
operator== to
bool operator== (const Int& i2) const {
return (this->i == i2.i ? true : false);
}
as you cannot bind a temporary (which Int(2) is) to an
lvalue reference.
Your other compilers are wrong in accepting the code.
Richard.