diff options
author | Howard Hinnant <hhinnant@apple.com> | 2011-06-04 21:32:33 +0000 |
---|---|---|
committer | Howard Hinnant <hhinnant@apple.com> | 2011-06-04 21:32:33 +0000 |
commit | 6971d82668f88a48aaa9373d22728069e454b82c (patch) | |
tree | 3c59ab5f2d22e87fe18a498a97b27b227d548495 /libcxx/test | |
parent | 06bd6d304e70c6afde37c24a499018ec48daf84c (diff) | |
download | bcm5719-llvm-6971d82668f88a48aaa9373d22728069e454b82c.tar.gz bcm5719-llvm-6971d82668f88a48aaa9373d22728069e454b82c.zip |
noexcept for <queue>.
llvm-svn: 132650
Diffstat (limited to 'libcxx/test')
10 files changed, 300 insertions, 0 deletions
diff --git a/libcxx/test/containers/container.adaptors/priority.queue/priqueue.cons/default_noexcept.pass.cpp b/libcxx/test/containers/container.adaptors/priority.queue/priqueue.cons/default_noexcept.pass.cpp new file mode 100644 index 00000000000..48e075698ad --- /dev/null +++ b/libcxx/test/containers/container.adaptors/priority.queue/priqueue.cons/default_noexcept.pass.cpp @@ -0,0 +1,31 @@ +//===----------------------------------------------------------------------===// +// +// 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> + +// priority_queue() +// noexcept(is_nothrow_default_constructible<container_type>::value && +// is_nothrow_default_constructible<Compare>::value); + +// This tests a conforming extension + +#include <queue> +#include <cassert> + +#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, ""); + } +#endif +} diff --git a/libcxx/test/containers/container.adaptors/priority.queue/priqueue.cons/dtor_noexcept.pass.cpp b/libcxx/test/containers/container.adaptors/priority.queue/priqueue.cons/dtor_noexcept.pass.cpp new file mode 100644 index 00000000000..80ad8bdb28b --- /dev/null +++ b/libcxx/test/containers/container.adaptors/priority.queue/priqueue.cons/dtor_noexcept.pass.cpp @@ -0,0 +1,27 @@ +//===----------------------------------------------------------------------===// +// +// 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> + +// ~priority_queue() // implied noexcept; + +#include <queue> +#include <cassert> + +#include "../../../MoveOnly.h" + +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/libcxx/test/containers/container.adaptors/priority.queue/priqueue.cons/move_assign_noexcept.pass.cpp b/libcxx/test/containers/container.adaptors/priority.queue/priqueue.cons/move_assign_noexcept.pass.cpp new file mode 100644 index 00000000000..7fd01d6dcb6 --- /dev/null +++ b/libcxx/test/containers/container.adaptors/priority.queue/priqueue.cons/move_assign_noexcept.pass.cpp @@ -0,0 +1,31 @@ +//===----------------------------------------------------------------------===// +// +// 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> + +// priority_queue& operator=(priority_queue&& c) +// noexcept(is_nothrow_move_assignable<container_type>::value && +// is_nothrow_move_assignable<Compare>::value); + +// This tests a conforming extension + +#include <queue> +#include <cassert> + +#include "../../../MoveOnly.h" + +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/libcxx/test/containers/container.adaptors/priority.queue/priqueue.cons/move_noexcept.pass.cpp b/libcxx/test/containers/container.adaptors/priority.queue/priqueue.cons/move_noexcept.pass.cpp new file mode 100644 index 00000000000..1e7fcd86b46 --- /dev/null +++ b/libcxx/test/containers/container.adaptors/priority.queue/priqueue.cons/move_noexcept.pass.cpp @@ -0,0 +1,31 @@ +//===----------------------------------------------------------------------===// +// +// 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> + +// priority_queue(priority_queue&&) +// noexcept(is_nothrow_move_constructible<container_type>::value && +// is_nothrow_move_constructible<Compare>::value); + +// This tests a conforming extension + +#include <queue> +#include <cassert> + +#include "../../../MoveOnly.h" + +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/libcxx/test/containers/container.adaptors/priority.queue/priqueue.special/swap_noexcept.pass.cpp b/libcxx/test/containers/container.adaptors/priority.queue/priqueue.special/swap_noexcept.pass.cpp new file mode 100644 index 00000000000..e40570a120b --- /dev/null +++ b/libcxx/test/containers/container.adaptors/priority.queue/priqueue.special/swap_noexcept.pass.cpp @@ -0,0 +1,32 @@ +//===----------------------------------------------------------------------===// +// +// 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> + +// void swap(priority_queue& c) +// noexcept(__is_nothrow_swappable<container_type>::value && +// __is_nothrow_swappable<Compare>::value); + +// This tests a conforming extension + +#include <queue> +#include <cassert> + +#include "../../../MoveOnly.h" + +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/libcxx/test/containers/container.adaptors/queue/queue.cons/default_noexcept.pass.cpp b/libcxx/test/containers/container.adaptors/queue/queue.cons/default_noexcept.pass.cpp new file mode 100644 index 00000000000..874577c7632 --- /dev/null +++ b/libcxx/test/containers/container.adaptors/queue/queue.cons/default_noexcept.pass.cpp @@ -0,0 +1,30 @@ +//===----------------------------------------------------------------------===// +// +// 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> + +// queue() +// noexcept(is_nothrow_default_constructible<container_type>::value); + +// This tests a conforming extension + +#include <queue> +#include <cassert> + +#include "../../../MoveOnly.h" + +int main() +{ +#if __has_feature(cxx_noexcept) + { + typedef std::queue<MoveOnly> C; + static_assert(std::is_nothrow_default_constructible<C>::value, ""); + } +#endif +} diff --git a/libcxx/test/containers/container.adaptors/queue/queue.cons/dtor_noexcept.pass.cpp b/libcxx/test/containers/container.adaptors/queue/queue.cons/dtor_noexcept.pass.cpp new file mode 100644 index 00000000000..1af20ecb04b --- /dev/null +++ b/libcxx/test/containers/container.adaptors/queue/queue.cons/dtor_noexcept.pass.cpp @@ -0,0 +1,27 @@ +//===----------------------------------------------------------------------===// +// +// 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> + +// ~queue() // implied noexcept; + +#include <queue> +#include <cassert> + +#include "../../../MoveOnly.h" + +int main() +{ +#if __has_feature(cxx_noexcept) + { + typedef std::queue<MoveOnly> C; + static_assert(std::is_nothrow_destructible<C>::value, ""); + } +#endif +} diff --git a/libcxx/test/containers/container.adaptors/queue/queue.cons/move_assign_noexcept.pass.cpp b/libcxx/test/containers/container.adaptors/queue/queue.cons/move_assign_noexcept.pass.cpp new file mode 100644 index 00000000000..1b45bfa93ee --- /dev/null +++ b/libcxx/test/containers/container.adaptors/queue/queue.cons/move_assign_noexcept.pass.cpp @@ -0,0 +1,30 @@ +//===----------------------------------------------------------------------===// +// +// 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> + +// queue& operator=(queue&& c) +// noexcept(is_nothrow_move_assignable<container_type>::value); + +// This tests a conforming extension + +#include <queue> +#include <cassert> + +#include "../../../MoveOnly.h" + +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/libcxx/test/containers/container.adaptors/queue/queue.cons/move_noexcept.pass.cpp b/libcxx/test/containers/container.adaptors/queue/queue.cons/move_noexcept.pass.cpp new file mode 100644 index 00000000000..8fba28fc534 --- /dev/null +++ b/libcxx/test/containers/container.adaptors/queue/queue.cons/move_noexcept.pass.cpp @@ -0,0 +1,30 @@ +//===----------------------------------------------------------------------===// +// +// 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> + +// queue(queue&&) +// noexcept(is_nothrow_move_constructible<container_type>::value); + +// This tests a conforming extension + +#include <queue> +#include <cassert> + +#include "../../../MoveOnly.h" + +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/libcxx/test/containers/container.adaptors/queue/queue.special/swap_noexcept.pass.cpp b/libcxx/test/containers/container.adaptors/queue/queue.special/swap_noexcept.pass.cpp new file mode 100644 index 00000000000..5c9b7756b8a --- /dev/null +++ b/libcxx/test/containers/container.adaptors/queue/queue.special/swap_noexcept.pass.cpp @@ -0,0 +1,31 @@ +//===----------------------------------------------------------------------===// +// +// 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> + +// void swap(queue& c) +// noexcept(__is_nothrow_swappable<container_type>::value); + +// This tests a conforming extension + +#include <queue> +#include <cassert> + +#include "../../../MoveOnly.h" + +int main() +{ +#if __has_feature(cxx_noexcept) + { + typedef std::queue<MoveOnly> C; + C c1, c2; + static_assert(noexcept(swap(c1, c2)), ""); + } +#endif +} |