diff options
Diffstat (limited to 'test/libcxx/containers/sequences/list/list.cons/db_move.pass.cpp')
| -rw-r--r-- | test/libcxx/containers/sequences/list/list.cons/db_move.pass.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/test/libcxx/containers/sequences/list/list.cons/db_move.pass.cpp b/test/libcxx/containers/sequences/list/list.cons/db_move.pass.cpp new file mode 100644 index 000000000000..dd424e89e756 --- /dev/null +++ b/test/libcxx/containers/sequences/list/list.cons/db_move.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. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03 + +// <list> + +// list(list&& c); + +#define _LIBCPP_DEBUG 1 +#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(1)) + +#include <list> +#include <cstdlib> +#include <cassert> +#include "MoveOnly.h" +#include "test_allocator.h" +#include "min_allocator.h" + +int main() +{ + std::list<int> l1 = {1, 2, 3}; + std::list<int>::iterator i = l1.begin(); + std::list<int> l2 = std::move(l1); + assert(*l2.erase(i) == 2); +} |
