From: paolo Date: Tue, 15 Mar 2005 23:38:54 +0000 (+0000) Subject: 2005-03-15 Paolo Carlini X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=72ecee2737bc91969157d52d0df801c08a5b00da;p=thirdparty%2Fgcc.git 2005-03-15 Paolo Carlini PR libstdc++/20352 * include/std/std_complex.h (pow(const complex<_Tp>&, const _Tp&)): On non-c99 platforms, don't try to compute log of complex zero. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@96538 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index bfda25db058a..20544556679a 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,10 @@ +2005-03-15 Paolo Carlini + + PR libstdc++/20352 + * include/std/std_complex.h (pow(const complex<_Tp>&, + const _Tp&)): On non-c99 platforms, don't try to compute + log of complex zero. + 2005-03-10 Ben Elliston * testsuite/22_locale/locale/cons/12658_thread-1.cc: Don't XFAIL diff --git a/libstdc++-v3/include/std/std_complex.h b/libstdc++-v3/include/std/std_complex.h index 694acdc41c9e..6c1e00337303 100644 --- a/libstdc++-v3/include/std/std_complex.h +++ b/libstdc++-v3/include/std/std_complex.h @@ -944,6 +944,10 @@ namespace std complex<_Tp> pow(const complex<_Tp>& __x, const _Tp& __y) { +#ifndef _GLIBCXX_USE_C99_COMPLEX + if (__x == _Tp()) + return _Tp(); +#endif if (__x.imag() == _Tp() && __x.real() > _Tp()) return pow(__x.real(), __y);