summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/containers/associative/map/map.cons/move_noexcept.pass.cpp
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2014-12-20 01:40:03 +0000
committerEric Fiselier <eric@efcs.ca>2014-12-20 01:40:03 +0000
commit5a83710e371fe68a06e6e3876c6a2c8b820a8976 (patch)
treeafde4c82ad6704681781c5cd49baa3fbd05c85db /libcxx/test/std/containers/associative/map/map.cons/move_noexcept.pass.cpp
parentf11e8eab527fba316c64112f6e05de1a79693a3e (diff)
downloadbcm5719-llvm-5a83710e371fe68a06e6e3876c6a2c8b820a8976.tar.gz
bcm5719-llvm-5a83710e371fe68a06e6e3876c6a2c8b820a8976.zip
Move test into test/std subdirectory.
llvm-svn: 224658
Diffstat (limited to 'libcxx/test/std/containers/associative/map/map.cons/move_noexcept.pass.cpp')
-rw-r--r--libcxx/test/std/containers/associative/map/map.cons/move_noexcept.pass.cpp51
1 files changed, 51 insertions, 0 deletions
diff --git a/libcxx/test/std/containers/associative/map/map.cons/move_noexcept.pass.cpp b/libcxx/test/std/containers/associative/map/map.cons/move_noexcept.pass.cpp
new file mode 100644
index 00000000000..6de4b67b326
--- /dev/null
+++ b/libcxx/test/std/containers/associative/map/map.cons/move_noexcept.pass.cpp
@@ -0,0 +1,51 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <map>
+
+// map(map&&)
+// noexcept(is_nothrow_move_constructible<allocator_type>::value &&
+// is_nothrow_move_constructible<key_compare>::value);
+
+// This tests a conforming extension
+
+#include <map>
+#include <cassert>
+
+#include "../../../MoveOnly.h"
+#include "test_allocator.h"
+
+template <class T>
+struct some_comp
+{
+ typedef T value_type;
+ some_comp(const some_comp&);
+};
+
+int main()
+{
+#if __has_feature(cxx_noexcept)
+ {
+ typedef std::map<MoveOnly, MoveOnly> C;
+ static_assert(std::is_nothrow_move_constructible<C>::value, "");
+ }
+ {
+ typedef std::map<MoveOnly, MoveOnly, std::less<MoveOnly>, test_allocator<MoveOnly>> C;
+ static_assert(std::is_nothrow_move_constructible<C>::value, "");
+ }
+ {
+ typedef std::map<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
+ static_assert(std::is_nothrow_move_constructible<C>::value, "");
+ }
+ {
+ typedef std::map<MoveOnly, MoveOnly, some_comp<MoveOnly>> C;
+ static_assert(!std::is_nothrow_move_constructible<C>::value, "");
+ }
+#endif
+}
OpenPOWER on IntegriCloud