94c39179608337619355dd6d0b8b084f2da524e9 |
|
17-Oct-2017 |
Eric Fiselier <eric@efcs.ca> |
[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 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@315994 91177308-0d34-0410-b5e6-96231b3b80d8
/external/libcxx/test/std/containers/sequences/vector/vector.cons/construct_iter_iter.pass.cpp
|
98605940df7a54649618c541b972a308cccaade9 |
|
06-Dec-2016 |
Stephan T. Lavavej <stl@exchange.microsoft.com> |
[libcxx] [test] D27021: Fix MSVC warning C4389 "signed/unsigned mismatch", part 8/12. Add static_cast<std::size_t> when comparing distance() to size(). These replacements were performed programmatically with regex_replace(): const vector<pair<regex, string>> reg_fmt = { { regex(R"(assert\((\w+)\.size\(\) == std::distance\((\w+, \w+)\)\))"), "assert($1.size() == static_cast<std::size_t>(std::distance($2)))" }, { regex(R"(assert\(distance\((\w+\.begin\(\), \w+\.end\(\))\) == (\w+)\.size\(\)\))"), "assert(static_cast<std::size_t>(distance($1)) == $2.size())" }, { regex(R"(assert\(std::distance\((\w+\.\w*begin\(\), \w+\.\w*end\(\))\) == (\w+)\.size\(\)\))"), "assert(static_cast<std::size_t>(std::distance($1)) == $2.size())" }, }; Also, include <cstddef> when it wasn't already being included. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@288745 91177308-0d34-0410-b5e6-96231b3b80d8
/external/libcxx/test/std/containers/sequences/vector/vector.cons/construct_iter_iter.pass.cpp
|
e465ff34be9174684929e35dcf031d970659f10f |
|
27-Oct-2016 |
Stephan T. Lavavej <stl@exchange.microsoft.com> |
[PATCH] D25483: [libcxx] [test] Fix non-Standard assumptions about how many elements are allocated git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@285346 91177308-0d34-0410-b5e6-96231b3b80d8
/external/libcxx/test/std/containers/sequences/vector/vector.cons/construct_iter_iter.pass.cpp
|
124ed406e56ed380279a6a05f996a96ff511af9d |
|
08-Oct-2016 |
Eric Fiselier <eric@efcs.ca> |
[libc++] Fix stack_allocator Summary: To quote STL the problems with stack allocator are" >"stack_allocator<T, N> is seriously nonconformant to N4582 17.6.3.5 [allocator.requirements]. > First, it lacks a rebinding constructor. (The nested "struct rebind" isn't sufficient.) > Second, it lacks templated equality/inequality. > Third, it completely ignores alignment. > Finally, and most severely, the Standard forbids its existence. Allocators are forbidden from returning memory "inside themselves". This requirement is implied by the Standard's requirements for rebinding and equality. It's permitted to return memory from a separate buffer object on the stack, though." This patch attempts to address all of those issues. First, instead of storing the buffer inside the allocator I've change `stack_allocator` to accept the buffer as an argument. Second, in order to fix rebinding I changed the parameter list from `<class T, size_t NumElements>` to `<class T, size_t NumBytes>`. This allows allocator rebinding between types that have different sizes. Third, I added copy and rebinding constructors and assignment operators. And finally I fixed the allocation logic to always return properly aligned storage. Reviewers: mclow.lists, howard.hinnant, STL_MSFT Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25154 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283631 91177308-0d34-0410-b5e6-96231b3b80d8
/external/libcxx/test/std/containers/sequences/vector/vector.cons/construct_iter_iter.pass.cpp
|
375e2f669cb882eb9a9700ab7fd1de8d2b57665f |
|
29-Apr-2016 |
Eric Fiselier <eric@efcs.ca> |
Guard libc++ specific c.__invariants() tests in LIBCPP_ASSERT macros git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@267947 91177308-0d34-0410-b5e6-96231b3b80d8
/external/libcxx/test/std/containers/sequences/vector/vector.cons/construct_iter_iter.pass.cpp
|
a90c6dd46005b2b14de3bb889a8d03bb34bd3256 |
|
20-Dec-2014 |
Eric Fiselier <eric@efcs.ca> |
Move test into test/std subdirectory. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@224658 91177308-0d34-0410-b5e6-96231b3b80d8
/external/libcxx/test/std/containers/sequences/vector/vector.cons/construct_iter_iter.pass.cpp
|