From 5a83710e371fe68a06e6e3876c6a2c8b820a8976 Mon Sep 17 00:00:00 2001 From: Eric Fiselier Date: Sat, 20 Dec 2014 01:40:03 +0000 Subject: Move test into test/std subdirectory. llvm-svn: 224658 --- .../string.cons/move_assign_noexcept.pass.cpp | 47 ++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 libcxx/test/std/strings/basic.string/string.cons/move_assign_noexcept.pass.cpp (limited to 'libcxx/test/std/strings/basic.string/string.cons/move_assign_noexcept.pass.cpp') diff --git a/libcxx/test/std/strings/basic.string/string.cons/move_assign_noexcept.pass.cpp b/libcxx/test/std/strings/basic.string/string.cons/move_assign_noexcept.pass.cpp new file mode 100644 index 00000000000..32c9514a915 --- /dev/null +++ b/libcxx/test/std/strings/basic.string/string.cons/move_assign_noexcept.pass.cpp @@ -0,0 +1,47 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// + +// basic_string& operator=(basic_string&& c) +// noexcept( +// allocator_type::propagate_on_container_move_assignment::value && +// is_nothrow_move_assignable::value); + +// This tests a conforming extension + +#include +#include + +#include "test_allocator.h" + +template +struct some_alloc +{ + typedef T value_type; + some_alloc(const some_alloc&); +}; + +int main() +{ +#if __has_feature(cxx_noexcept) + { + typedef std::string C; + static_assert(std::is_nothrow_move_assignable::value, ""); + } + { + typedef std::basic_string, test_allocator> C; + static_assert(!std::is_nothrow_move_assignable::value, ""); + } + { + typedef std::basic_string, some_alloc> C; + static_assert(!std::is_nothrow_move_assignable::value, ""); + } +#endif +} -- cgit v1.2.3