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 //===----------------------------------------------------------------------===//
12 // noexcept(is_nothrow_move_constructible<allocator_type>::value);
14 // This tests a conforming extension
21 #include "test_macros.h"
22 #include "test_allocator.h"
28 some_alloc(const some_alloc
&);
33 #if defined(_LIBCPP_VERSION)
35 typedef std::vector
<bool> C
;
36 static_assert(std::is_nothrow_move_constructible
<C
>::value
, "");
39 typedef std::vector
<bool, test_allocator
<bool>> C
;
40 static_assert(std::is_nothrow_move_constructible
<C
>::value
, "");
43 typedef std::vector
<bool, other_allocator
<bool>> C
;
44 static_assert(std::is_nothrow_move_constructible
<C
>::value
, "");
46 #endif // _LIBCPP_VERSION
48 // In C++17, move constructors for allocators are not allowed to throw
50 #if defined(_LIBCPP_VERSION)
51 typedef std::vector
<bool, some_alloc
<bool>> C
;
52 static_assert( std::is_nothrow_move_constructible
<C
>::value
, "");
53 #endif // _LIBCPP_VERSION
55 typedef std::vector
<bool, some_alloc
<bool>> C
;
56 static_assert(!std::is_nothrow_move_constructible
<C
>::value
, "");