Cleanup _LIBCPP_HAS_NO_<c++11-feature> macro uses in std::stack.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300602 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Fiselier
2017-04-18 21:16:26 +00:00
parent ce924dce57
commit 7162dceba5
11 changed files with 38 additions and 47 deletions

View File

@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03
// <stack>
// stack& operator=(stack&& q);
@@ -16,7 +18,6 @@
#include "MoveOnly.h"
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class C>
C
@@ -28,15 +29,12 @@ make(int n)
return c;
}
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
int main()
{
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
std::stack<MoveOnly> q(make<std::deque<MoveOnly> >(5));
std::stack<MoveOnly> q2;
q2 = std::move(q);
assert(q2.size() == 5);
assert(q.empty());
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}

View File

@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03
// <stack>
// void push(value_type&& v);
@@ -18,7 +20,6 @@
int main()
{
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
std::stack<MoveOnly> q;
q.push(MoveOnly(1));
assert(q.size() == 1);
@@ -29,5 +30,4 @@ int main()
q.push(MoveOnly(3));
assert(q.size() == 3);
assert(q.top() == MoveOnly(3));
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}