diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2015-05-13 14:32:31 +0100 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2015-05-13 14:32:31 +0100 |
commit | d0cad9fef03ed3cac4b33cfdaa0a33cacb1a8af4 (patch) | |
tree | 53ad1f99c8f9402103e9da3c07be9af5d6404510 /libstdc++-v3 | |
parent | ac68f97cfe269d57f3d6d7ed2960cb738eb192e8 (diff) | |
download | gcc-d0cad9fef03ed3cac4b33cfdaa0a33cacb1a8af4.zip gcc-d0cad9fef03ed3cac4b33cfdaa0a33cacb1a8af4.tar.gz gcc-d0cad9fef03ed3cac4b33cfdaa0a33cacb1a8af4.tar.bz2 |
* include/std/complex (polar): Check for negative rho (LWG 2459).
From-SVN: r223159
Diffstat (limited to 'libstdc++-v3')
-rw-r--r-- | libstdc++-v3/ChangeLog | 2 | ||||
-rw-r--r-- | libstdc++-v3/include/std/complex | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index a22a565..af4d5be 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,7 @@ 2015-05-13 Jonathan Wakely <jwakely@redhat.com> + * include/std/complex (polar): Check for negative rho (LWG 2459). + * include/experimental/tuple (apply): Handle pointers to member (LWG 2418). * include/std/functional (_Mem_fn_base): Make constructors constexpr. diff --git a/libstdc++-v3/include/std/complex b/libstdc++-v3/include/std/complex index 585683c..f2a6cf9 100644 --- a/libstdc++-v3/include/std/complex +++ b/libstdc++-v3/include/std/complex @@ -667,7 +667,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template<typename _Tp> inline complex<_Tp> polar(const _Tp& __rho, const _Tp& __theta) - { return complex<_Tp>(__rho * cos(__theta), __rho * sin(__theta)); } + { + _GLIBCXX_DEBUG_ASSERT( __rho >= 0 ); + return complex<_Tp>(__rho * cos(__theta), __rho * sin(__theta)); + } template<typename _Tp> inline complex<_Tp> |