Commit Graph

4 Commits

Author SHA1 Message Date
Louis Dionne 255a60cdd6 [libc++] Make some testing utilities constexpr
This will be needed in order to test constexpr std::vector.
2020-09-02 10:05:44 -04:00
Eric Fiselier ffcc7c6c38 fix shadowing warnings in new tests, try 2
llvm-svn: 316009
2017-10-17 16:06:42 +00:00
Eric Fiselier 8092cbfbc3 fix shadowing warnings in new tests
llvm-svn: 315997
2017-10-17 13:45:20 +00:00
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