summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2017-02-18 14:44:14 +0000
committerdim <dim@FreeBSD.org>2017-02-18 14:44:14 +0000
commit529339915e663a6d483fe6e50117f4d1766989a0 (patch)
tree8cfd9532892582a2a13ef3ce647835f9658eda71
parentd3b5abd4282ad6ec83d3d0e2697e4c32e1094664 (diff)
downloadFreeBSD-src-529339915e663a6d483fe6e50117f4d1766989a0.zip
FreeBSD-src-529339915e663a6d483fe6e50117f4d1766989a0.tar.gz
Pull in r242377 from upstream libc++ trunk (by Marshall Clow):
Make sure that __libcpp_compressed_pair_imp default-constructs its' members, rather than value-initializing them. Fixes PR#24137 This ensures std::make_shared<>'s default constructor properly initializes to zero. Direct commit to stable/9 and stable/10, since stable/11 and head already have a newer version of libc++, including this fix. Reported by: martin.beran@kernun.cz PR: 217200
-rw-r--r--contrib/libc++/include/memory14
1 files changed, 7 insertions, 7 deletions
diff --git a/contrib/libc++/include/memory b/contrib/libc++/include/memory
index 662faa0..804b351 100644
--- a/contrib/libc++/include/memory
+++ b/contrib/libc++/include/memory
@@ -1950,11 +1950,11 @@ public:
typedef const typename remove_reference<_T1>::type& _T1_const_reference;
typedef const typename remove_reference<_T2>::type& _T2_const_reference;
- _LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp() {}
+ _LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp() : __first_(), __second_() {}
_LIBCPP_INLINE_VISIBILITY explicit __libcpp_compressed_pair_imp(_T1_param __t1)
- : __first_(_VSTD::forward<_T1_param>(__t1)) {}
+ : __first_(_VSTD::forward<_T1_param>(__t1)), __second_() {}
_LIBCPP_INLINE_VISIBILITY explicit __libcpp_compressed_pair_imp(_T2_param __t2)
- : __second_(_VSTD::forward<_T2_param>(__t2)) {}
+ : __first_(), __second_(_VSTD::forward<_T2_param>(__t2)) {}
_LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp(_T1_param __t1, _T2_param __t2)
: __first_(_VSTD::forward<_T1_param>(__t1)), __second_(_VSTD::forward<_T2_param>(__t2)) {}
@@ -2043,9 +2043,9 @@ public:
typedef const _T1& _T1_const_reference;
typedef const typename remove_reference<_T2>::type& _T2_const_reference;
- _LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp() {}
+ _LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp() : __second_() {}
_LIBCPP_INLINE_VISIBILITY explicit __libcpp_compressed_pair_imp(_T1_param __t1)
- : _T1(_VSTD::forward<_T1_param>(__t1)) {}
+ : _T1(_VSTD::forward<_T1_param>(__t1)), __second_() {}
_LIBCPP_INLINE_VISIBILITY explicit __libcpp_compressed_pair_imp(_T2_param __t2)
: __second_(_VSTD::forward<_T2_param>(__t2)) {}
_LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp(_T1_param __t1, _T2_param __t2)
@@ -2133,11 +2133,11 @@ public:
typedef const typename remove_reference<_T1>::type& _T1_const_reference;
typedef const _T2& _T2_const_reference;
- _LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp() {}
+ _LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp() : __first_() {}
_LIBCPP_INLINE_VISIBILITY explicit __libcpp_compressed_pair_imp(_T1_param __t1)
: __first_(_VSTD::forward<_T1_param>(__t1)) {}
_LIBCPP_INLINE_VISIBILITY explicit __libcpp_compressed_pair_imp(_T2_param __t2)
- : _T2(_VSTD::forward<_T2_param>(__t2)) {}
+ : _T2(_VSTD::forward<_T2_param>(__t2)), __first_() {}
_LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp(_T1_param __t1, _T2_param __t2)
_NOEXCEPT_(is_nothrow_move_constructible<_T1>::value &&
is_nothrow_move_constructible<_T2>::value)
OpenPOWER on IntegriCloud