Revert "Merge to upstream r304942."
This reverts commit83b1388ecd, reversing changes made tof20819f925. Test: treehugger Bug: None
This commit is contained in:
@@ -15,7 +15,6 @@
|
||||
#include <stack>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "test_allocator.h"
|
||||
|
||||
struct test
|
||||
@@ -25,10 +24,10 @@ struct test
|
||||
|
||||
explicit test(const test_allocator<int>& a) : base(a) {}
|
||||
test(const container_type& c, const test_allocator<int>& a) : base(c, a) {}
|
||||
#if TEST_STD_VER >= 11
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
test(container_type&& c, const test_allocator<int>& a) : base(std::move(c), a) {}
|
||||
test(test&& q, const test_allocator<int>& a) : base(std::move(q), a) {}
|
||||
#endif
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
test_allocator<int> get_allocator() {return c.get_allocator();}
|
||||
};
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
#include <cassert>
|
||||
#include <cstddef>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "test_allocator.h"
|
||||
|
||||
template <class C>
|
||||
@@ -38,10 +37,10 @@ struct test
|
||||
|
||||
explicit test(const test_allocator<int>& a) : base(a) {}
|
||||
test(const container_type& c, const test_allocator<int>& a) : base(c, a) {}
|
||||
#if TEST_STD_VER >= 11
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
test(container_type&& c, const test_allocator<int>& a) : base(std::move(c), a) {}
|
||||
test(test&& q, const test_allocator<int>& a) : base(std::move(q), a) {}
|
||||
#endif
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
test_allocator<int> get_allocator() {return c.get_allocator();}
|
||||
};
|
||||
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// UNSUPPORTED: c++98, c++03
|
||||
|
||||
// <stack>
|
||||
|
||||
// template <class Alloc>
|
||||
@@ -20,6 +18,7 @@
|
||||
#include "test_allocator.h"
|
||||
#include "MoveOnly.h"
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
template <class C>
|
||||
C
|
||||
@@ -48,10 +47,13 @@ struct test
|
||||
allocator_type get_allocator() {return this->c.get_allocator();}
|
||||
};
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
int main()
|
||||
{
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
test<MoveOnly> q(make<C>(5), test_allocator<MoveOnly>(4));
|
||||
assert(q.get_allocator() == test_allocator<MoveOnly>(4));
|
||||
assert(q.size() == 5);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
}
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// UNSUPPORTED: c++98, c++03
|
||||
|
||||
// <stack>
|
||||
|
||||
// template <class Alloc>
|
||||
@@ -20,6 +18,7 @@
|
||||
#include "test_allocator.h"
|
||||
#include "MoveOnly.h"
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
template <class C>
|
||||
C
|
||||
@@ -48,11 +47,14 @@ struct test
|
||||
allocator_type get_allocator() {return this->c.get_allocator();}
|
||||
};
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
int main()
|
||||
{
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
test<MoveOnly> q(make<C>(5), test_allocator<MoveOnly>(4));
|
||||
test<MoveOnly> q2(std::move(q), test_allocator<MoveOnly>(5));
|
||||
assert(q2.get_allocator() == test_allocator<MoveOnly>(5));
|
||||
assert(q2.size() == 5);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user