summaryrefslogtreecommitdiff
path: root/include/memory
diff options
context:
space:
mode:
authorMarshall Clow <mclow.lists@gmail.com>2015-06-19 15:54:13 +0000
committerMarshall Clow <mclow.lists@gmail.com>2015-06-19 15:54:13 +0000
commitc41133728d1a4197b8d0a366854b73d161788d20 (patch)
tree7969eb230de74cce6967bd16970c4b98474c8829 /include/memory
parent3d08766099b89b92fdabd40b75325cb395c174ee (diff)
Fix PR#18843. Thanks to Howard for the fix
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@240136 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/memory')
-rw-r--r--include/memory5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/memory b/include/memory
index 03897b1c2..4c3a18c99 100644
--- a/include/memory
+++ b/include/memory
@@ -4073,7 +4073,10 @@ private:
__enable_weak_this(const enable_shared_from_this<_Yp>* __e) _NOEXCEPT
{
if (__e)
- __e->__weak_this_ = *this;
+ {
+ __e->__weak_this_.__ptr_ = const_cast<_Yp*>(static_cast<const _Yp*>(__e));
+ __e->__weak_this_.__cntrl_ = __cntrl_;
+ }
}
_LIBCPP_INLINE_VISIBILITY