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
This commit is contained in:
Marshall Clow
2015-09-22 17:57:41 +00:00
parent 6b0e4195eb
commit 842e3f6f51

View File

@@ -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 @@ int main()
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);
}
}