This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
gcc-3.0: Obvious infinite recursion not detected
- To: gcc at gcc dot gnu dot org
- Subject: gcc-3.0: Obvious infinite recursion not detected
- From: Ryszard Kabatek <Ryszard dot Kabatek at softax dot pl>
- Date: Thu, 05 Jul 2001 09:55:41 +0200
- Reply-To: Ryszard dot Kabatek at softax dot pl
The sample below compiles well (g++ -Wall) without any warning.
The call of operator == leads to an infinite recursion,
but the compiler does not warn.
class X {};
bool operator==(const X& lhs, const X& rhs)
{
return lhs == rhs;
}
int main()
{
X l;
X r;
l == r;
}
Regards
--
Ryszard Kabatek