1 //===----------------------------------------------------------------------===//
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
7 //===----------------------------------------------------------------------===//
13 // basic_string(basic_string&&)
14 // noexcept(is_nothrow_move_constructible<allocator_type>::value); // constexpr since C++20
16 // This tests a conforming extension
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
, "");
38 static_assert(std::is_nothrow_move_constructible
<C
>::value
, "");