Check in the test for PR#24890 that I forgot in previous commit
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@248305 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/std/utilities/utility/pairs/pairs.pair/swap.pass.cpp b/test/std/utilities/utility/pairs/pairs.pair/swap.pass.cpp
index a912df0..2e72f35 100644
--- a/test/std/utilities/utility/pairs/pairs.pair/swap.pass.cpp
+++ b/test/std/utilities/utility/pairs/pairs.pair/swap.pass.cpp
@@ -16,6 +16,14 @@
#include <utility>
#include <cassert>
+struct S {
+ int i;
+ S() : i(0) {}
+ S(int j) : i(j) {}
+ S const * operator& () const { assert(false); return this; }
+ bool operator==(int x) const { return i == x; }
+ };
+
int main()
{
{
@@ -28,4 +36,14 @@
assert(p2.first == 3);
assert(p2.second == 4);
}
+ {
+ typedef std::pair<int, S> P1;
+ P1 p1(3, S(4));
+ P1 p2(5, S(6));
+ p1.swap(p2);
+ assert(p1.first == 5);
+ assert(p1.second == 6);
+ assert(p2.first == 3);
+ assert(p2.second == 4);
+ }
}