aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Carlini <pcarlini@suse.de>2005-03-15 23:38:54 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2005-03-15 23:38:54 +0000
commitb0de85997de6e241995d4bea75e62e5f7dd438b9 (patch)
treee93b190505df4746ab63224f75ba0cdfee540cc6
parent69f39b11aae0baeeba798fa1e6dead8845ce35ce (diff)
downloadgcc-b0de85997de6e241995d4bea75e62e5f7dd438b9.zip
gcc-b0de85997de6e241995d4bea75e62e5f7dd438b9.tar.gz
gcc-b0de85997de6e241995d4bea75e62e5f7dd438b9.tar.bz2
re PR libstdc++/20352 (FAIL: 26_numerics/complex/pow.cc execution test)
2005-03-15 Paolo Carlini <pcarlini@suse.de> 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. From-SVN: r96538
-rw-r--r--libstdc++-v3/ChangeLog7
-rw-r--r--libstdc++-v3/include/std/std_complex.h4
2 files changed, 11 insertions, 0 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index bfda25d..2054455 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,10 @@
+2005-03-15 Paolo Carlini <pcarlini@suse.de>
+
+ 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 <bje@au.ibm.com>
* 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 694acdc..6c1e003 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);