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(stack&& q);
@@ -16,7 +18,6 @@
#include "MoveOnly.h"
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class C>
C
@@ -28,14 +29,11 @@ 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 = 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>
// explicit stack(container_type&& c);
@@ -16,7 +18,6 @@
#include "MoveOnly.h"
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class C>
C
@@ -28,12 +29,9 @@ 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));
assert(q.size() == 5);
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}

View File

@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03
// <stack>
// stack()
@@ -24,10 +26,8 @@
int main()
{
#if defined(_LIBCPP_VERSION)
{
typedef std::stack<MoveOnly> C;
static_assert(std::is_nothrow_default_constructible<C>::value, "");
}
#endif // _LIBCPP_VERSION
}

View File

@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03
// <stack>
// stack(stack&&)
@@ -24,10 +26,8 @@
int main()
{
#if defined(_LIBCPP_VERSION)
{
typedef std::stack<MoveOnly> C;
static_assert(std::is_nothrow_move_constructible<C>::value, "");
}
#endif // _LIBCPP_VERSION
}