summaryrefslogtreecommitdiffstats
path: root/libcxx/include/valarray
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2014-08-12 00:06:58 +0000
committerEric Fiselier <eric@efcs.ca>2014-08-12 00:06:58 +0000
commit981a64c380bea01b35d3426e194c8f8f5f7ec709 (patch)
treec32428fb0c75b18368af94bd05adc6a3f7090180 /libcxx/include/valarray
parente31acf239a94ac402ce568867cf93cd2ac6fa1e9 (diff)
downloadbcm5719-llvm-981a64c380bea01b35d3426e194c8f8f5f7ec709.tar.gz
bcm5719-llvm-981a64c380bea01b35d3426e194c8f8f5f7ec709.zip
Add return statement to slice_array and mask_array assignment. Closes PR20614.
This patch just adds the required return statements to slice_array::operator= and mask_array::operator=. Tests were added to check that the return value is the same as the object assigned to. llvm-svn: 215414
Diffstat (limited to 'libcxx/include/valarray')
-rw-r--r--libcxx/include/valarray2
1 files changed, 2 insertions, 0 deletions
diff --git a/libcxx/include/valarray b/libcxx/include/valarray
index 3714350edff..2b942046db9 100644
--- a/libcxx/include/valarray
+++ b/libcxx/include/valarray
@@ -1220,6 +1220,7 @@ slice_array<_Tp>::operator=(const slice_array& __sa) const
const value_type* __s = __sa.__vp_;
for (size_t __n = __size_; __n; --__n, __t += __stride_, __s += __sa.__stride_)
*__t = *__s;
+ return *this;
}
template <class _Tp>
@@ -2090,6 +2091,7 @@ mask_array<_Tp>::operator=(const mask_array& __ma) const
size_t __n = __1d_.size();
for (size_t __i = 0; __i < __n; ++__i)
__vp_[__1d_[__i]] = __ma.__vp_[__1d_[__i]];
+ return *this;
}
template <class _Tp>
OpenPOWER on IntegriCloud