From a04d2b333055a342f419b8aa8a88fd47fc4e75df Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Tue, 10 Jan 2012 15:15:47 +0000 Subject: [PATCH] Fix http://llvm.org/bugs/show_bug.cgi?id=11734 llvm-svn: 147853 --- libcxx/include/complex | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/libcxx/include/complex b/libcxx/include/complex index e7f63eac3a1e..3b660a35a9ab 100644 --- a/libcxx/include/complex +++ b/libcxx/include/complex @@ -282,7 +282,8 @@ public: _LIBCPP_INLINE_VISIBILITY void real(value_type __re) {__re_ = __re;} _LIBCPP_INLINE_VISIBILITY void imag(value_type __im) {__im_ = __im;} - _LIBCPP_INLINE_VISIBILITY complex& operator= (const value_type& __re) {__re_ = __re; return *this;} + _LIBCPP_INLINE_VISIBILITY complex& operator= (const value_type& __re) + {__re_ = __re; __im_ = value_type(); return *this;} _LIBCPP_INLINE_VISIBILITY complex& operator+=(const value_type& __re) {__re_ += __re; return *this;} _LIBCPP_INLINE_VISIBILITY complex& operator-=(const value_type& __re) {__re_ -= __re; return *this;} _LIBCPP_INLINE_VISIBILITY complex& operator*=(const value_type& __re) {__re_ *= __re; __im_ *= __re; return *this;} @@ -340,7 +341,8 @@ public: _LIBCPP_INLINE_VISIBILITY void real(value_type __re) {__re_ = __re;} _LIBCPP_INLINE_VISIBILITY void imag(value_type __im) {__im_ = __im;} - _LIBCPP_INLINE_VISIBILITY complex& operator= (float __re) {__re_ = __re; return *this;} + _LIBCPP_INLINE_VISIBILITY complex& operator= (float __re) + {__re_ = __re; __im_ = value_type(); return *this;} _LIBCPP_INLINE_VISIBILITY complex& operator+=(float __re) {__re_ += __re; return *this;} _LIBCPP_INLINE_VISIBILITY complex& operator-=(float __re) {__re_ -= __re; return *this;} _LIBCPP_INLINE_VISIBILITY complex& operator*=(float __re) {__re_ *= __re; __im_ *= __re; return *this;} @@ -395,7 +397,8 @@ public: _LIBCPP_INLINE_VISIBILITY void real(value_type __re) {__re_ = __re;} _LIBCPP_INLINE_VISIBILITY void imag(value_type __im) {__im_ = __im;} - _LIBCPP_INLINE_VISIBILITY complex& operator= (double __re) {__re_ = __re; return *this;} + _LIBCPP_INLINE_VISIBILITY complex& operator= (double __re) + {__re_ = __re; __im_ = value_type(); return *this;} _LIBCPP_INLINE_VISIBILITY complex& operator+=(double __re) {__re_ += __re; return *this;} _LIBCPP_INLINE_VISIBILITY complex& operator-=(double __re) {__re_ -= __re; return *this;} _LIBCPP_INLINE_VISIBILITY complex& operator*=(double __re) {__re_ *= __re; __im_ *= __re; return *this;} @@ -450,7 +453,8 @@ public: _LIBCPP_INLINE_VISIBILITY void real(value_type __re) {__re_ = __re;} _LIBCPP_INLINE_VISIBILITY void imag(value_type __im) {__im_ = __im;} - _LIBCPP_INLINE_VISIBILITY complex& operator= (long double __re) {__re_ = __re; return *this;} + _LIBCPP_INLINE_VISIBILITY complex& operator= (long double __re) + {__re_ = __re; __im_ = value_type(); return *this;} _LIBCPP_INLINE_VISIBILITY complex& operator+=(long double __re) {__re_ += __re; return *this;} _LIBCPP_INLINE_VISIBILITY complex& operator-=(long double __re) {__re_ -= __re; return *this;} _LIBCPP_INLINE_VISIBILITY complex& operator*=(long double __re) {__re_ *= __re; __im_ *= __re; return *this;}