llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons
Eric Fiselier 1c0cedccb6 [libc++] Fix PR34898 - vector iterator constructors and assign method perform push_back instead of emplace_back.
Summary:
The constructors `vector(Iter, Iter, Alloc = Alloc{})` and `assign(Iter, Iter)` don't correctly perform EmplaceConstruction from the result of dereferencing the iterator. This results in them performing an additional and unneeded copy.

This patch addresses the issue by correctly using `emplace_back` in C++11 and newer.

There are also some bugs in our `insert` implementation, but those will be handled separately. 

@mclow.lists We should probably merge this into 5.1, agreed?

Reviewers: mclow.lists, dlj, EricWF

Reviewed By: mclow.lists, EricWF

Subscribers: cfe-commits, mclow.lists

Differential Revision: https://reviews.llvm.org/D38757

llvm-svn: 315994
2017-10-17 13:03:17 +00:00
..
assign_copy.pass.cpp Replace __cplusplus comparisons and dialect __has_feature checks with TEST_STD_VER. 2016-06-14 21:31:42 +00:00
assign_initializer_list.pass.cpp Replace _LIBCPP_HAS_NO_<C++03 feature> with _LIBCPP_CXX03_LANG in vector. 2017-04-16 02:40:45 +00:00
assign_iter_iter.pass.cpp [libc++] Fix PR34898 - vector iterator constructors and assign method perform push_back instead of emplace_back. 2017-10-17 13:03:17 +00:00
assign_move.pass.cpp Replace _LIBCPP_HAS_NO_<C++03 feature> with _LIBCPP_CXX03_LANG in vector. 2017-04-16 02:40:45 +00:00
assign_size_value.pass.cpp Replace __cplusplus comparisons and dialect __has_feature checks with TEST_STD_VER. 2016-06-14 21:31:42 +00:00
construct_default.pass.cpp [libcxx] [test] Untabify, NFC. 2017-07-29 00:55:10 +00:00
construct_iter_iter.pass.cpp [libc++] Fix PR34898 - vector iterator constructors and assign method perform push_back instead of emplace_back. 2017-10-17 13:03:17 +00:00
construct_iter_iter_alloc.pass.cpp [libc++] Fix PR34898 - vector iterator constructors and assign method perform push_back instead of emplace_back. 2017-10-17 13:03:17 +00:00
construct_size.pass.cpp fix warnings only produced by apple-clang 2016-12-24 01:07:54 +00:00
construct_size_value.pass.cpp [PATCH] D25483: [libcxx] [test] Fix non-Standard assumptions about how many elements are allocated 2016-10-27 21:25:12 +00:00
construct_size_value_alloc.pass.cpp Guard libc++ specific c.__invariants() tests in LIBCPP_ASSERT macros 2016-04-28 22:28:23 +00:00
copy.pass.cpp [libcxx] [test] D27269: Fix MSVC x64 warning C4267 "conversion from 'size_t' to 'int' [or 'unsigned int'], possible loss of data", part 3/4. 2016-12-06 01:14:51 +00:00
copy_alloc.pass.cpp [libcxx] [test] D27269: Fix MSVC x64 warning C4267 "conversion from 'size_t' to 'int' [or 'unsigned int'], possible loss of data", part 3/4. 2016-12-06 01:14:51 +00:00
default.recursive.pass.cpp
default_noexcept.pass.cpp Replace __cplusplus comparisons and dialect __has_feature checks with TEST_STD_VER. 2016-06-14 21:31:42 +00:00
dtor_noexcept.pass.cpp [libcxx] [test] Fix Clang -Wunused-local-typedef, part 1/3. 2017-02-05 22:47:09 +00:00
initializer_list.pass.cpp Replace _LIBCPP_HAS_NO_<C++03 feature> with _LIBCPP_CXX03_LANG in vector. 2017-04-16 02:40:45 +00:00
initializer_list_alloc.pass.cpp Replace _LIBCPP_HAS_NO_<C++03 feature> with _LIBCPP_CXX03_LANG in vector. 2017-04-16 02:40:45 +00:00
move.pass.cpp Replace _LIBCPP_HAS_NO_<C++03 feature> with _LIBCPP_CXX03_LANG in vector. 2017-04-16 02:40:45 +00:00
move_alloc.pass.cpp Replace _LIBCPP_HAS_NO_<C++03 feature> with _LIBCPP_CXX03_LANG in vector. 2017-04-16 02:40:45 +00:00
move_assign_noexcept.pass.cpp Replace __cplusplus comparisons and dialect __has_feature checks with TEST_STD_VER. 2016-06-14 21:31:42 +00:00
move_noexcept.pass.cpp Replace __cplusplus comparisons and dialect __has_feature checks with TEST_STD_VER. 2016-06-14 21:31:42 +00:00
op_equal_initializer_list.pass.cpp Replace _LIBCPP_HAS_NO_<C++03 feature> with _LIBCPP_CXX03_LANG in vector. 2017-04-16 02:40:45 +00:00