[PATCH] D22972: [libcxx] [test] Fix an MSVC x64 compiler error due to mismatched iterator types.
Stephan T. Lavavej via cfe-commits
cfe-commits at lists.llvm.org
Fri Jul 29 12:58:38 PDT 2016
STL_MSFT created this revision.
STL_MSFT added reviewers: EricWF, mclow.lists.
STL_MSFT added a subscriber: cfe-commits.
Fix an MSVC x64 compiler error due to mismatched iterator types.
This was attempting to store a list<int, test_allocator<int>>::iterator in a list<int>::iterator. That isn't guaranteed by the Standard, and MSVC x64 rejects it (even though our list iterators are SCARY) because test_allocator has 32-bit size_type/difference_type, and our iterators take that into account even as they erase the allocator type itself.
https://reviews.llvm.org/D22972
Files:
test/std/containers/sequences/list/list.cons/initializer_list_alloc.pass.cpp
Index: test/std/containers/sequences/list/list.cons/initializer_list_alloc.pass.cpp
===================================================================
--- test/std/containers/sequences/list/list.cons/initializer_list_alloc.pass.cpp
+++ test/std/containers/sequences/list/list.cons/initializer_list_alloc.pass.cpp
@@ -24,7 +24,7 @@
std::list<int, test_allocator<int>> d({3, 4, 5, 6}, test_allocator<int>(3));
assert(d.get_allocator() == test_allocator<int>(3));
assert(d.size() == 4);
- std::list<int>::iterator i = d.begin();
+ std::list<int, test_allocator<int>>::iterator i = d.begin();
assert(*i++ == 3);
assert(*i++ == 4);
assert(*i++ == 5);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22972.66163.patch
Type: text/x-patch
Size: 683 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160729/83bab49b/attachment.bin>
More information about the cfe-commits
mailing list