Always use the allocator to construct/destruct elements of a deque/vector. Fixes PR#28412. Thanks to Jonathan Wakely for the report.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@275105 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Marshall Clow
2016-07-11 21:38:08 +00:00
parent 45e9a936b6
commit 51d7e8e381
6 changed files with 125 additions and 6 deletions

View File

@@ -1812,9 +1812,9 @@ vector<_Tp, _Allocator>::emplace(const_iterator __position, _Args&&... __args)
}
else
{
value_type __tmp(_VSTD::forward<_Args>(__args)...);
__temp_value<value_type, _Allocator> __tmp(this->__alloc(), _VSTD::forward<_Args>(__args)...);
__move_range(__p, this->__end_, __p + 1);
*__p = _VSTD::move(__tmp);
*__p = _VSTD::move(__tmp.get());
}
__annotator.__done();
}