llvm-project/libcxx
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
..
benchmarks [locale] Avoid copy of __atoms when char_type is char 2017-06-14 23:17:45 +00:00
cmake Make libcxx tests work when llvm sources are not present. 2017-09-20 16:01:50 +00:00
docs [libc++] Support Microsoft ABI without vcruntime headers 2017-10-09 19:25:17 +00:00
fuzzing More fuzzing infastructre - regex 2017-10-12 14:48:09 +00:00
include [libc++] Fix PR34898 - vector iterator constructors and assign method perform push_back instead of emplace_back. 2017-10-17 13:03:17 +00:00
lib Update changelog revision 2017-09-17 21:00:27 +00:00
src [libc++] Support Microsoft ABI without vcruntime headers 2017-10-09 19:25:17 +00:00
test [libc++] Fix PR34898 - vector iterator constructors and assign method perform push_back instead of emplace_back. 2017-10-17 13:03:17 +00:00
utils [libc++] Support Microsoft ABI without vcruntime headers 2017-10-09 19:25:17 +00:00
www [libcxx] [www] Change an absolute link to cxx1z_status.html to be relative. 2017-08-31 17:59:51 +00:00
.arcconfig Upgrade arcconfig to use https 2016-07-18 02:02:49 +00:00
.clang-format Make clang-format use C++03 syntax 2017-04-15 02:45:43 +00:00
.gitignore Implement N4606 optional 2016-10-12 07:46:20 +00:00
CMakeLists.txt [libc++] Support Microsoft ABI without vcruntime headers 2017-10-09 19:25:17 +00:00
CREDITS.TXT Updated email address in `CREDITS.txt`. 2017-03-06 20:46:55 +00:00
LICENSE.TXT Update year to 2017 2017-01-03 11:20:43 +00:00
NOTES.TXT Update doc and various cleanup 2016-12-23 20:00:13 +00:00
TODO.TXT Add list of filesystem NB comments to TODO.TXT so they can be tracked separately 2017-03-06 21:23:36 +00:00
appveyor-reqs-install.cmd Upgrade Clang version used by appveyor 2017-06-01 01:00:59 +00:00
appveyor.yml Rename Appveyor install helper script. 2017-05-10 02:43:02 +00:00