Always use the allocator to construct/destruct elements of a deque/vector. Fixes PR#28412. Thanks to Jonathan Wakely for the report.
llvm-svn: 275105
Cr-Mirrored-From: sso://chromium.googlesource.com/_direct/external/github.com/llvm/llvm-project
Cr-Mirrored-Commit: dc3eb83d08d63d41824d87e64c10021faee44c6e
diff --git a/include/vector b/include/vector
index 81c514e..021bbfb 100644
--- a/include/vector
+++ b/include/vector
@@ -1812,9 +1812,9 @@
}
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();
}