This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/20758] operator-(const T&, const complex<T>&) vs operator-(const complex<T>&, const complex<T>&)
- From: "kreckel at ginac dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Apr 2005 21:52:25 -0000
- Subject: [Bug libstdc++/20758] operator-(const T&, const complex<T>&) vs operator-(const complex<T>&, const complex<T>&)
- References: <20050404213802.20758.kreckel@ginac.de>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From kreckel at ginac dot de 2005-04-04 21:52 -------
Subject: Re: operator-(const T&, const complex<T>&) vs
operator-(const complex<T>&, const complex<T>&)
I don't see how you can trigger wrong behaviour with
operator-(const complex<T> &lhs, const T &rhs):
template<typename _Tp>
inline complex<_Tp>
operator-(const complex<_Tp>& __x, const _Tp& __y)
{
complex<_Tp> __r = __x;
__r.real() -= __y;
return __r;
}
Isn't the unary operator- a necessary ingredient for the bug because it
silently changes the sign of zero?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20758