[mlir][acc] Introduce MappableType interface (#122146)
[llvm-project.git] / libcxx / test / std / strings / basic.string / string.cons / move_noexcept.pass.cpp
blobd807cac2c72c84865091d046342522a38c5dc858
1 //===----------------------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: c++03
11 // <string>
13 // basic_string(basic_string&&)
14 // noexcept(is_nothrow_move_constructible<allocator_type>::value); // constexpr since C++20
16 // This tests a conforming extension
18 #include <string>
19 #include <cassert>
21 #include "test_macros.h"
22 #include "test_allocator.h"
24 int main(int, char**) {
26 typedef std::string C;
27 static_assert(std::is_nothrow_move_constructible<C>::value, "");
30 typedef std::basic_string<char, std::char_traits<char>, test_allocator<char>> C;
31 static_assert(std::is_nothrow_move_constructible<C>::value, "");
34 typedef std::basic_string<char, std::char_traits<char>, limited_allocator<char, 10>> C;
35 #if TEST_STD_VER <= 14
36 static_assert(!std::is_nothrow_move_constructible<C>::value, "");
37 #else
38 static_assert(std::is_nothrow_move_constructible<C>::value, "");
39 #endif
42 return 0;