[PATCH] D54806: [libcxx] Fix incorrect iterator type in vector container test.
Andrey Maksimov via Phabricator
reviews at reviews.llvm.org
Wed Nov 21 10:42:19 PST 2018
amakc11 created this revision.
Herald added a reviewer: EricWF.
Herald added subscribers: libcxx-commits, ldionne.
The iterator types for different specializations of containers with the same element type but different allocators are not required to be convertible. This patch makes the test to take the iterator type from the same container specialization as the created container.
Repository:
rCXX libc++
https://reviews.llvm.org/D54806
Files:
test/std/containers/sequences/vector/vector.modifiers/insert_iter_iter_iter.pass.cpp
Index: test/std/containers/sequences/vector/vector.modifiers/insert_iter_iter_iter.pass.cpp
===================================================================
--- test/std/containers/sequences/vector/vector.modifiers/insert_iter_iter_iter.pass.cpp
+++ test/std/containers/sequences/vector/vector.modifiers/insert_iter_iter_iter.pass.cpp
@@ -98,7 +98,7 @@
std::vector<int, limited_allocator<int, 308> > v(100);
int a[] = {1, 2, 3, 4, 5};
const int N = sizeof(a)/sizeof(a[0]);
- std::vector<int>::iterator i = v.insert(v.cbegin() + 10, input_iterator<const int*>(a),
+ std::vector<int, limited_allocator<int, 308> >::iterator i = v.insert(v.cbegin() + 10, input_iterator<const int*>(a),
input_iterator<const int*>(a+N));
assert(v.size() == 100 + N);
assert(is_contiguous_container_asan_correct(v));
@@ -115,7 +115,7 @@
std::vector<int, limited_allocator<int, 300> > v(100);
int a[] = {1, 2, 3, 4, 5};
const int N = sizeof(a)/sizeof(a[0]);
- std::vector<int>::iterator i = v.insert(v.cbegin() + 10, forward_iterator<const int*>(a),
+ std::vector<int, limited_allocator<int, 300> >::iterator i = v.insert(v.cbegin() + 10, forward_iterator<const int*>(a),
forward_iterator<const int*>(a+N));
assert(v.size() == 100 + N);
assert(is_contiguous_container_asan_correct(v));
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54806.174951.patch
Type: text/x-patch
Size: 1466 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20181121/f8e5c4d5/attachment.bin>
More information about the libcxx-commits
mailing list