Author: dim
Date: Sat Feb 18 14:44:14 2017
New Revision: 313916
URL: https://svnweb.freebsd.org/changeset/base/313916

Log:
  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.be...@kernun.cz
  PR:           217200

Modified:
  stable/10/contrib/libc++/include/memory

Changes in other areas also in this revision:
Modified:
  stable/9/contrib/libc++/include/memory

Modified: stable/10/contrib/libc++/include/memory
==============================================================================
--- stable/10/contrib/libc++/include/memory     Sat Feb 18 11:43:13 2017        
(r313915)
+++ stable/10/contrib/libc++/include/memory     Sat Feb 18 14:44:14 2017        
(r313916)
@@ -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)
_______________________________________________
svn-src-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-unsubscr...@freebsd.org"

Reply via email to