aboutsummaryrefslogtreecommitdiff
path: root/test/std/containers/container.adaptors
diff options
context:
space:
mode:
Diffstat (limited to 'test/std/containers/container.adaptors')
-rw-r--r--test/std/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_comp_cont_alloc.pass.cpp5
-rw-r--r--test/std/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_comp_rcont_alloc.pass.cpp5
-rw-r--r--test/std/containers/container.adaptors/priority.queue/priqueue.cons/default_noexcept.pass.cpp7
-rw-r--r--test/std/containers/container.adaptors/priority.queue/priqueue.cons/dtor_noexcept.pass.cpp4
-rw-r--r--test/std/containers/container.adaptors/priority.queue/priqueue.cons/move_assign_noexcept.pass.cpp4
-rw-r--r--test/std/containers/container.adaptors/priority.queue/priqueue.cons/move_noexcept.pass.cpp4
-rw-r--r--test/std/containers/container.adaptors/priority.queue/priqueue.special/swap_noexcept.pass.cpp4
-rw-r--r--test/std/containers/container.adaptors/priority.queue/types.fail.cpp35
-rw-r--r--test/std/containers/container.adaptors/priority.queue/types.pass.cpp22
-rw-r--r--test/std/containers/container.adaptors/queue/queue.cons/default_noexcept.pass.cpp7
-rw-r--r--test/std/containers/container.adaptors/queue/queue.cons/dtor_noexcept.pass.cpp4
-rw-r--r--test/std/containers/container.adaptors/queue/queue.cons/move_assign_noexcept.pass.cpp4
-rw-r--r--test/std/containers/container.adaptors/queue/queue.cons/move_noexcept.pass.cpp4
-rw-r--r--test/std/containers/container.adaptors/queue/queue.defn/types.fail.cpp (renamed from test/std/containers/container.adaptors/queue/version.pass.cpp)8
-rw-r--r--test/std/containers/container.adaptors/queue/queue.defn/types.pass.cpp14
-rw-r--r--test/std/containers/container.adaptors/queue/queue.special/swap_noexcept.pass.cpp4
-rw-r--r--test/std/containers/container.adaptors/stack/stack.cons/default_noexcept.pass.cpp7
-rw-r--r--test/std/containers/container.adaptors/stack/stack.cons/dtor_noexcept.pass.cpp4
-rw-r--r--test/std/containers/container.adaptors/stack/stack.cons/move_assign_noexcept.pass.cpp4
-rw-r--r--test/std/containers/container.adaptors/stack/stack.cons/move_noexcept.pass.cpp4
-rw-r--r--test/std/containers/container.adaptors/stack/stack.defn/types.fail.cpp35
-rw-r--r--test/std/containers/container.adaptors/stack/stack.defn/types.pass.cpp14
-rw-r--r--test/std/containers/container.adaptors/stack/stack.special/swap_noexcept.pass.cpp4
-rw-r--r--test/std/containers/container.adaptors/stack/version.pass.cpp20
24 files changed, 145 insertions, 82 deletions
diff --git a/test/std/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_comp_cont_alloc.pass.cpp b/test/std/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_comp_cont_alloc.pass.cpp
index 66ca614126f4..dc5cca3c5568 100644
--- a/test/std/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_comp_cont_alloc.pass.cpp
+++ b/test/std/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_comp_cont_alloc.pass.cpp
@@ -16,6 +16,7 @@
#include <queue>
#include <cassert>
+#include "test_macros.h"
#include "test_allocator.h"
template <class C>
@@ -41,11 +42,11 @@ struct test
: base(comp, a) {}
test(const value_compare& comp, const container_type& c,
const test_allocator<int>& a) : base(comp, c, a) {}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11 // testing rvalue constructor
test(const value_compare& comp, container_type&& c,
const test_allocator<int>& a) : base(comp, std::move(c), a) {}
test(test&& q, const test_allocator<int>& a) : base(std::move(q), a) {}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif
test_allocator<int> get_allocator() {return c.get_allocator();}
using base::c;
diff --git a/test/std/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_comp_rcont_alloc.pass.cpp b/test/std/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_comp_rcont_alloc.pass.cpp
index 643b0c625abb..a27a6e205123 100644
--- a/test/std/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_comp_rcont_alloc.pass.cpp
+++ b/test/std/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_comp_rcont_alloc.pass.cpp
@@ -16,6 +16,7 @@
#include <queue>
#include <cassert>
+#include "test_macros.h"
#include "test_allocator.h"
template <class C>
@@ -41,11 +42,11 @@ struct test
: base(comp, a) {}
test(const value_compare& comp, const container_type& c,
const test_allocator<int>& a) : base(comp, c, a) {}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11 // testing rvalue ctor
test(const value_compare& comp, container_type&& c,
const test_allocator<int>& a) : base(comp, std::move(c), a) {}
test(test&& q, const test_allocator<int>& a) : base(std::move(q), a) {}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif
test_allocator<int> get_allocator() {return c.get_allocator();}
using base::c;
diff --git a/test/std/containers/container.adaptors/priority.queue/priqueue.cons/default_noexcept.pass.cpp b/test/std/containers/container.adaptors/priority.queue/priqueue.cons/default_noexcept.pass.cpp
index cdfa58b58554..c79feb93eb6c 100644
--- a/test/std/containers/container.adaptors/priority.queue/priqueue.cons/default_noexcept.pass.cpp
+++ b/test/std/containers/container.adaptors/priority.queue/priqueue.cons/default_noexcept.pass.cpp
@@ -15,17 +15,18 @@
// This tests a conforming extension
+// UNSUPPORTED: c++98, c++03
+
#include <queue>
#include <cassert>
+#include "test_macros.h"
#include "MoveOnly.h"
int main()
{
-#if __has_feature(cxx_noexcept)
{
typedef std::priority_queue<MoveOnly> C;
- static_assert(std::is_nothrow_default_constructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
}
-#endif
}
diff --git a/test/std/containers/container.adaptors/priority.queue/priqueue.cons/dtor_noexcept.pass.cpp b/test/std/containers/container.adaptors/priority.queue/priqueue.cons/dtor_noexcept.pass.cpp
index e3d071d9aad0..3cedefef2c87 100644
--- a/test/std/containers/container.adaptors/priority.queue/priqueue.cons/dtor_noexcept.pass.cpp
+++ b/test/std/containers/container.adaptors/priority.queue/priqueue.cons/dtor_noexcept.pass.cpp
@@ -11,6 +11,8 @@
// ~priority_queue() // implied noexcept;
+// UNSUPPORTED: c++98, c++03
+
#include <queue>
#include <cassert>
@@ -18,10 +20,8 @@
int main()
{
-#if __has_feature(cxx_noexcept)
{
typedef std::priority_queue<MoveOnly> C;
static_assert(std::is_nothrow_destructible<C>::value, "");
}
-#endif
}
diff --git a/test/std/containers/container.adaptors/priority.queue/priqueue.cons/move_assign_noexcept.pass.cpp b/test/std/containers/container.adaptors/priority.queue/priqueue.cons/move_assign_noexcept.pass.cpp
index 590d82fe6da4..f14c3ae7ce43 100644
--- a/test/std/containers/container.adaptors/priority.queue/priqueue.cons/move_assign_noexcept.pass.cpp
+++ b/test/std/containers/container.adaptors/priority.queue/priqueue.cons/move_assign_noexcept.pass.cpp
@@ -15,6 +15,8 @@
// This tests a conforming extension
+// UNSUPPORTED: c++98, c++03
+
#include <queue>
#include <cassert>
@@ -22,10 +24,8 @@
int main()
{
-#if __has_feature(cxx_noexcept)
{
typedef std::priority_queue<MoveOnly> C;
static_assert(std::is_nothrow_move_assignable<C>::value, "");
}
-#endif
}
diff --git a/test/std/containers/container.adaptors/priority.queue/priqueue.cons/move_noexcept.pass.cpp b/test/std/containers/container.adaptors/priority.queue/priqueue.cons/move_noexcept.pass.cpp
index 05ff253d31b4..0218992670f2 100644
--- a/test/std/containers/container.adaptors/priority.queue/priqueue.cons/move_noexcept.pass.cpp
+++ b/test/std/containers/container.adaptors/priority.queue/priqueue.cons/move_noexcept.pass.cpp
@@ -15,6 +15,8 @@
// This tests a conforming extension
+// UNSUPPORTED: c++98, c++03
+
#include <queue>
#include <cassert>
@@ -22,10 +24,8 @@
int main()
{
-#if __has_feature(cxx_noexcept)
{
typedef std::priority_queue<MoveOnly> C;
static_assert(std::is_nothrow_move_constructible<C>::value, "");
}
-#endif
}
diff --git a/test/std/containers/container.adaptors/priority.queue/priqueue.special/swap_noexcept.pass.cpp b/test/std/containers/container.adaptors/priority.queue/priqueue.special/swap_noexcept.pass.cpp
index 4d2b441c60ee..bfff607590fe 100644
--- a/test/std/containers/container.adaptors/priority.queue/priqueue.special/swap_noexcept.pass.cpp
+++ b/test/std/containers/container.adaptors/priority.queue/priqueue.special/swap_noexcept.pass.cpp
@@ -15,6 +15,8 @@
// This tests a conforming extension
+// UNSUPPORTED: c++98, c++03
+
#include <queue>
#include <cassert>
@@ -22,11 +24,9 @@
int main()
{
-#if __has_feature(cxx_noexcept)
{
typedef std::priority_queue<MoveOnly> C;
C c1, c2;
static_assert(noexcept(swap(c1, c2)), "");
}
-#endif
}
diff --git a/test/std/containers/container.adaptors/priority.queue/types.fail.cpp b/test/std/containers/container.adaptors/priority.queue/types.fail.cpp
new file mode 100644
index 000000000000..0d3025e1739a
--- /dev/null
+++ b/test/std/containers/container.adaptors/priority.queue/types.fail.cpp
@@ -0,0 +1,35 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <queue>
+
+// template <class T, class Container = vector<T>,
+// class Compare = less<typename Container::value_type>>
+// class priority_queue
+// {
+// public:
+// typedef Container container_type;
+// typedef typename container_type::value_type value_type;
+// typedef typename container_type::reference reference;
+// typedef typename container_type::const_reference const_reference;
+// typedef typename container_type::size_type size_type;
+//
+// protected:
+// container_type c;
+// Compare comp;
+
+#include <queue>
+#include <cassert>
+#include <type_traits>
+
+int main()
+{
+// LWG#2566 says that the first template param must match the second one's value type
+ std::priority_queue<double, std::deque<int>> t;
+}
diff --git a/test/std/containers/container.adaptors/priority.queue/types.pass.cpp b/test/std/containers/container.adaptors/priority.queue/types.pass.cpp
index ade20d47d4e3..6bc476a3ce05 100644
--- a/test/std/containers/container.adaptors/priority.queue/types.pass.cpp
+++ b/test/std/containers/container.adaptors/priority.queue/types.pass.cpp
@@ -15,6 +15,7 @@
// {
// public:
// typedef Container container_type;
+// typedef Compare value_compare; // LWG#2684
// typedef typename container_type::value_type value_type;
// typedef typename container_type::reference reference;
// typedef typename container_type::const_reference const_reference;
@@ -26,7 +27,11 @@
#include <queue>
#include <cassert>
+#include <deque>
+#include <functional>
+#include <memory>
#include <type_traits>
+#include <vector>
struct test
: private std::priority_queue<int>
@@ -48,13 +53,16 @@ struct C
int main()
{
- static_assert((std::is_same<std::priority_queue<int>::container_type, std::vector<int> >::value), "");
- static_assert((std::is_same<std::priority_queue<double, std::deque<int> >::container_type, std::deque<int> >::value), "");
- static_assert((std::is_same<std::priority_queue<double, std::deque<int> >::value_type, int>::value), "");
- static_assert((std::is_same<std::priority_queue<int>::reference, std::vector<int>::reference>::value), "");
- static_assert((std::is_same<std::priority_queue<int>::const_reference, std::vector<int>::const_reference>::value), "");
- static_assert((std::is_same<std::priority_queue<int>::size_type, std::vector<int>::size_type>::value), "");
- static_assert((std::uses_allocator<std::priority_queue<int>, std::allocator<int> >::value), "");
+ static_assert(( std::is_same<std::priority_queue<int>::container_type, std::vector<int> >::value), "");
+ static_assert(( std::is_same<std::priority_queue<int, std::deque<int> >::container_type, std::deque<int> >::value), "");
+ static_assert(( std::is_same<std::priority_queue<int, std::deque<int> >::value_type, int>::value), "");
+ static_assert(( std::is_same<std::priority_queue<int>::reference, std::vector<int>::reference>::value), "");
+ static_assert(( std::is_same<std::priority_queue<int>::const_reference, std::vector<int>::const_reference>::value), "");
+ static_assert(( std::is_same<std::priority_queue<int>::size_type, std::vector<int>::size_type>::value), "");
+ static_assert(( std::is_same<std::priority_queue<int>::value_compare, std::less<int> >::value), "");
+ static_assert(( std::is_same<std::priority_queue<int, std::deque<int> >::value_compare, std::less<int> >::value), "");
+ static_assert(( std::is_same<std::priority_queue<int, std::deque<int>, std::greater<int> >::value_compare, std::greater<int> >::value), "");
+ static_assert(( std::uses_allocator<std::priority_queue<int>, std::allocator<int> >::value), "");
static_assert((!std::uses_allocator<std::priority_queue<int, C>, std::allocator<int> >::value), "");
test t;
}
diff --git a/test/std/containers/container.adaptors/queue/queue.cons/default_noexcept.pass.cpp b/test/std/containers/container.adaptors/queue/queue.cons/default_noexcept.pass.cpp
index 392853432669..43045893fe07 100644
--- a/test/std/containers/container.adaptors/queue/queue.cons/default_noexcept.pass.cpp
+++ b/test/std/containers/container.adaptors/queue/queue.cons/default_noexcept.pass.cpp
@@ -14,17 +14,18 @@
// This tests a conforming extension
+// UNSUPPORTED: c++98, c++03
+
#include <queue>
#include <cassert>
+#include "test_macros.h"
#include "MoveOnly.h"
int main()
{
-#if __has_feature(cxx_noexcept)
{
typedef std::queue<MoveOnly> C;
- static_assert(std::is_nothrow_default_constructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
}
-#endif
}
diff --git a/test/std/containers/container.adaptors/queue/queue.cons/dtor_noexcept.pass.cpp b/test/std/containers/container.adaptors/queue/queue.cons/dtor_noexcept.pass.cpp
index d9b8f731f28a..2a6783287b09 100644
--- a/test/std/containers/container.adaptors/queue/queue.cons/dtor_noexcept.pass.cpp
+++ b/test/std/containers/container.adaptors/queue/queue.cons/dtor_noexcept.pass.cpp
@@ -11,6 +11,8 @@
// ~queue() // implied noexcept;
+// UNSUPPORTED: c++98, c++03
+
#include <queue>
#include <cassert>
@@ -18,10 +20,8 @@
int main()
{
-#if __has_feature(cxx_noexcept)
{
typedef std::queue<MoveOnly> C;
static_assert(std::is_nothrow_destructible<C>::value, "");
}
-#endif
}
diff --git a/test/std/containers/container.adaptors/queue/queue.cons/move_assign_noexcept.pass.cpp b/test/std/containers/container.adaptors/queue/queue.cons/move_assign_noexcept.pass.cpp
index beef0f12ffb7..42e1c458c9da 100644
--- a/test/std/containers/container.adaptors/queue/queue.cons/move_assign_noexcept.pass.cpp
+++ b/test/std/containers/container.adaptors/queue/queue.cons/move_assign_noexcept.pass.cpp
@@ -14,6 +14,8 @@
// This tests a conforming extension
+// UNSUPPORTED: c++98, c++03
+
#include <queue>
#include <cassert>
@@ -21,10 +23,8 @@
int main()
{
-#if __has_feature(cxx_noexcept)
{
typedef std::queue<MoveOnly> C;
static_assert(std::is_nothrow_move_assignable<C>::value, "");
}
-#endif
}
diff --git a/test/std/containers/container.adaptors/queue/queue.cons/move_noexcept.pass.cpp b/test/std/containers/container.adaptors/queue/queue.cons/move_noexcept.pass.cpp
index 2402e609b988..1c13b622c0a5 100644
--- a/test/std/containers/container.adaptors/queue/queue.cons/move_noexcept.pass.cpp
+++ b/test/std/containers/container.adaptors/queue/queue.cons/move_noexcept.pass.cpp
@@ -14,6 +14,8 @@
// This tests a conforming extension
+// UNSUPPORTED: c++98, c++03
+
#include <queue>
#include <cassert>
@@ -21,10 +23,8 @@
int main()
{
-#if __has_feature(cxx_noexcept)
{
typedef std::queue<MoveOnly> C;
static_assert(std::is_nothrow_move_constructible<C>::value, "");
}
-#endif
}
diff --git a/test/std/containers/container.adaptors/queue/version.pass.cpp b/test/std/containers/container.adaptors/queue/queue.defn/types.fail.cpp
index 35b94b33c517..2b8341fff009 100644
--- a/test/std/containers/container.adaptors/queue/version.pass.cpp
+++ b/test/std/containers/container.adaptors/queue/queue.defn/types.fail.cpp
@@ -10,11 +10,11 @@
// <queue>
#include <queue>
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
+#include <cassert>
+#include <type_traits>
int main()
{
+// LWG#2566 says that the first template param must match the second one's value type
+ std::queue<double, std::deque<int>> t;
}
diff --git a/test/std/containers/container.adaptors/queue/queue.defn/types.pass.cpp b/test/std/containers/container.adaptors/queue/queue.defn/types.pass.cpp
index cc918a361707..7f1883a16838 100644
--- a/test/std/containers/container.adaptors/queue/queue.defn/types.pass.cpp
+++ b/test/std/containers/container.adaptors/queue/queue.defn/types.pass.cpp
@@ -46,13 +46,13 @@ struct C
int main()
{
- static_assert((std::is_same<std::queue<int>::container_type, std::deque<int> >::value), "");
- static_assert((std::is_same<std::queue<double, std::vector<int> >::container_type, std::vector<int> >::value), "");
- static_assert((std::is_same<std::queue<double, std::vector<int> >::value_type, int>::value), "");
- static_assert((std::is_same<std::queue<int>::reference, std::deque<int>::reference>::value), "");
- static_assert((std::is_same<std::queue<int>::const_reference, std::deque<int>::const_reference>::value), "");
- static_assert((std::is_same<std::queue<int>::size_type, std::deque<int>::size_type>::value), "");
- static_assert((std::uses_allocator<std::queue<int>, std::allocator<int> >::value), "");
+ static_assert(( std::is_same<std::queue<int>::container_type, std::deque<int> >::value), "");
+ static_assert(( std::is_same<std::queue<int, std::vector<int> >::container_type, std::vector<int> >::value), "");
+ static_assert(( std::is_same<std::queue<int, std::vector<int> >::value_type, int>::value), "");
+ static_assert(( std::is_same<std::queue<int>::reference, std::deque<int>::reference>::value), "");
+ static_assert(( std::is_same<std::queue<int>::const_reference, std::deque<int>::const_reference>::value), "");
+ static_assert(( std::is_same<std::queue<int>::size_type, std::deque<int>::size_type>::value), "");
+ static_assert(( std::uses_allocator<std::queue<int>, std::allocator<int> >::value), "");
static_assert((!std::uses_allocator<std::queue<int, C>, std::allocator<int> >::value), "");
test t;
}
diff --git a/test/std/containers/container.adaptors/queue/queue.special/swap_noexcept.pass.cpp b/test/std/containers/container.adaptors/queue/queue.special/swap_noexcept.pass.cpp
index cfe4a1bb7076..e18f80a91198 100644
--- a/test/std/containers/container.adaptors/queue/queue.special/swap_noexcept.pass.cpp
+++ b/test/std/containers/container.adaptors/queue/queue.special/swap_noexcept.pass.cpp
@@ -14,6 +14,8 @@
// This tests a conforming extension
+// UNSUPPORTED: c++98, c++03
+
#include <queue>
#include <cassert>
@@ -21,11 +23,9 @@
int main()
{
-#if __has_feature(cxx_noexcept)
{
typedef std::queue<MoveOnly> C;
C c1, c2;
static_assert(noexcept(swap(c1, c2)), "");
}
-#endif
}
diff --git a/test/std/containers/container.adaptors/stack/stack.cons/default_noexcept.pass.cpp b/test/std/containers/container.adaptors/stack/stack.cons/default_noexcept.pass.cpp
index bab55863b55f..2d1f9437fc45 100644
--- a/test/std/containers/container.adaptors/stack/stack.cons/default_noexcept.pass.cpp
+++ b/test/std/containers/container.adaptors/stack/stack.cons/default_noexcept.pass.cpp
@@ -14,17 +14,18 @@
// This tests a conforming extension
+// UNSUPPORTED: c++98, c++03
+
#include <stack>
#include <cassert>
+#include "test_macros.h"
#include "MoveOnly.h"
int main()
{
-#if __has_feature(cxx_noexcept)
{
typedef std::stack<MoveOnly> C;
- static_assert(std::is_nothrow_default_constructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
}
-#endif
}
diff --git a/test/std/containers/container.adaptors/stack/stack.cons/dtor_noexcept.pass.cpp b/test/std/containers/container.adaptors/stack/stack.cons/dtor_noexcept.pass.cpp
index 477bd57a6d10..0a0111b4dc46 100644
--- a/test/std/containers/container.adaptors/stack/stack.cons/dtor_noexcept.pass.cpp
+++ b/test/std/containers/container.adaptors/stack/stack.cons/dtor_noexcept.pass.cpp
@@ -11,6 +11,8 @@
// ~stack() // implied noexcept;
+// UNSUPPORTED: c++98, c++03
+
#include <stack>
#include <cassert>
@@ -18,10 +20,8 @@
int main()
{
-#if __has_feature(cxx_noexcept)
{
typedef std::stack<MoveOnly> C;
static_assert(std::is_nothrow_destructible<C>::value, "");
}
-#endif
}
diff --git a/test/std/containers/container.adaptors/stack/stack.cons/move_assign_noexcept.pass.cpp b/test/std/containers/container.adaptors/stack/stack.cons/move_assign_noexcept.pass.cpp
index dd836796dc17..d5822839cabf 100644
--- a/test/std/containers/container.adaptors/stack/stack.cons/move_assign_noexcept.pass.cpp
+++ b/test/std/containers/container.adaptors/stack/stack.cons/move_assign_noexcept.pass.cpp
@@ -14,6 +14,8 @@
// This tests a conforming extension
+// UNSUPPORTED: c++98, c++03
+
#include <stack>
#include <cassert>
@@ -21,10 +23,8 @@
int main()
{
-#if __has_feature(cxx_noexcept)
{
typedef std::stack<MoveOnly> C;
static_assert(std::is_nothrow_move_assignable<C>::value, "");
}
-#endif
}
diff --git a/test/std/containers/container.adaptors/stack/stack.cons/move_noexcept.pass.cpp b/test/std/containers/container.adaptors/stack/stack.cons/move_noexcept.pass.cpp
index cfc660b36def..7eb563c76835 100644
--- a/test/std/containers/container.adaptors/stack/stack.cons/move_noexcept.pass.cpp
+++ b/test/std/containers/container.adaptors/stack/stack.cons/move_noexcept.pass.cpp
@@ -14,6 +14,8 @@
// This tests a conforming extension
+// UNSUPPORTED: c++98, c++03
+
#include <stack>
#include <cassert>
@@ -21,10 +23,8 @@
int main()
{
-#if __has_feature(cxx_noexcept)
{
typedef std::stack<MoveOnly> C;
static_assert(std::is_nothrow_move_constructible<C>::value, "");
}
-#endif
}
diff --git a/test/std/containers/container.adaptors/stack/stack.defn/types.fail.cpp b/test/std/containers/container.adaptors/stack/stack.defn/types.fail.cpp
new file mode 100644
index 000000000000..ee4c5441e7c3
--- /dev/null
+++ b/test/std/containers/container.adaptors/stack/stack.defn/types.fail.cpp
@@ -0,0 +1,35 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <queue>
+
+// template <class T, class Container = vector<T>,
+// class Compare = less<typename Container::value_type>>
+// class priority_queue
+// {
+// public:
+// typedef Container container_type;
+// typedef typename container_type::value_type value_type;
+// typedef typename container_type::reference reference;
+// typedef typename container_type::const_reference const_reference;
+// typedef typename container_type::size_type size_type;
+//
+// protected:
+// container_type c;
+// Compare comp;
+
+#include <stack>
+#include <cassert>
+#include <type_traits>
+
+int main()
+{
+// LWG#2566 says that the first template param must match the second one's value type
+ std::stack<double, std::deque<int>> t;
+}
diff --git a/test/std/containers/container.adaptors/stack/stack.defn/types.pass.cpp b/test/std/containers/container.adaptors/stack/stack.defn/types.pass.cpp
index afc5ebd53753..77a798b8382a 100644
--- a/test/std/containers/container.adaptors/stack/stack.defn/types.pass.cpp
+++ b/test/std/containers/container.adaptors/stack/stack.defn/types.pass.cpp
@@ -47,13 +47,13 @@ struct C
int main()
{
- static_assert((std::is_same<std::stack<int>::container_type, std::deque<int> >::value), "");
- static_assert((std::is_same<std::stack<double, std::vector<int> >::container_type, std::vector<int> >::value), "");
- static_assert((std::is_same<std::stack<double, std::vector<int> >::value_type, int>::value), "");
- static_assert((std::is_same<std::stack<int>::reference, std::deque<int>::reference>::value), "");
- static_assert((std::is_same<std::stack<int>::const_reference, std::deque<int>::const_reference>::value), "");
- static_assert((std::is_same<std::stack<int>::size_type, std::deque<int>::size_type>::value), "");
- static_assert((std::uses_allocator<std::stack<int>, std::allocator<int> >::value), "");
+ static_assert(( std::is_same<std::stack<int>::container_type, std::deque<int> >::value), "");
+ static_assert(( std::is_same<std::stack<int, std::vector<int> >::container_type, std::vector<int> >::value), "");
+ static_assert(( std::is_same<std::stack<int, std::vector<int> >::value_type, int>::value), "");
+ static_assert(( std::is_same<std::stack<int>::reference, std::deque<int>::reference>::value), "");
+ static_assert(( std::is_same<std::stack<int>::const_reference, std::deque<int>::const_reference>::value), "");
+ static_assert(( std::is_same<std::stack<int>::size_type, std::deque<int>::size_type>::value), "");
+ static_assert(( std::uses_allocator<std::stack<int>, std::allocator<int> >::value), "");
static_assert((!std::uses_allocator<std::stack<int, C>, std::allocator<int> >::value), "");
test t;
}
diff --git a/test/std/containers/container.adaptors/stack/stack.special/swap_noexcept.pass.cpp b/test/std/containers/container.adaptors/stack/stack.special/swap_noexcept.pass.cpp
index 80e024f5f1e0..976e362a0483 100644
--- a/test/std/containers/container.adaptors/stack/stack.special/swap_noexcept.pass.cpp
+++ b/test/std/containers/container.adaptors/stack/stack.special/swap_noexcept.pass.cpp
@@ -14,6 +14,8 @@
// This tests a conforming extension
+// UNSUPPORTED: c++98, c++03
+
#include <stack>
#include <cassert>
@@ -21,11 +23,9 @@
int main()
{
-#if __has_feature(cxx_noexcept)
{
typedef std::stack<MoveOnly> C;
C c1, c2;
static_assert(noexcept(swap(c1, c2)), "");
}
-#endif
}
diff --git a/test/std/containers/container.adaptors/stack/version.pass.cpp b/test/std/containers/container.adaptors/stack/version.pass.cpp
deleted file mode 100644
index 339d0f4dda8f..000000000000
--- a/test/std/containers/container.adaptors/stack/version.pass.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <stack>
-
-#include <stack>
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main()
-{
-}