[PATCH] D26623: [libcxx] [test] Swapping non-equal non-POCS allocators is UB.
Stephan T. Lavavej via cfe-commits
cfe-commits at lists.llvm.org
Mon Nov 14 12:04:46 PST 2016
STL_MSFT created this revision.
STL_MSFT added reviewers: EricWF, mclow.lists.
STL_MSFT added a subscriber: cfe-commits.
[libcxx] [test] Swapping non-equal non-POCS allocators is UB.
test_allocator is a non-POCS allocator. Instead of swapping containers
with A(1) and A(2), which triggers undefined behavior,
swapping A(3) with A(3) is conformant.
test/std/containers/sequences/vector/vector.special/swap.pass.cpp
Remove "#ifndef _LIBCPP_DEBUG_LEVEL" and a comment about
the now-fixed undefined behavior.
https://reviews.llvm.org/D26623
Files:
test/std/containers/associative/map/map.special/non_member_swap.pass.cpp
test/std/containers/associative/multimap/multimap.special/non_member_swap.pass.cpp
test/std/containers/associative/multiset/multiset.special/non_member_swap.pass.cpp
test/std/containers/associative/set/set.special/non_member_swap.pass.cpp
test/std/containers/sequences/deque/deque.special/swap.pass.cpp
test/std/containers/sequences/forwardlist/forwardlist.spec/member_swap.pass.cpp
test/std/containers/sequences/forwardlist/forwardlist.spec/non_member_swap.pass.cpp
test/std/containers/sequences/vector.bool/swap.pass.cpp
test/std/containers/sequences/vector/vector.special/swap.pass.cpp
test/std/containers/unord/unord.map/swap_member.pass.cpp
test/std/containers/unord/unord.map/unord.map.swap/swap_non_member.pass.cpp
test/std/containers/unord/unord.multimap/swap_member.pass.cpp
test/std/containers/unord/unord.multimap/unord.multimap.swap/swap_non_member.pass.cpp
test/std/containers/unord/unord.multiset/swap_member.pass.cpp
test/std/containers/unord/unord.multiset/unord.multiset.swap/swap_non_member.pass.cpp
test/std/containers/unord/unord.set/swap_member.pass.cpp
test/std/containers/unord/unord.set/unord.set.swap/swap_non_member.pass.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26623.77854.patch
Type: text/x-patch
Size: 59117 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161114/9f98ba41/attachment-0001.bin>
More information about the cfe-commits
mailing list