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 //===----------------------------------------------------------------------===//
11 // vector& operator=(vector&& c)
13 // allocator_type::propagate_on_container_move_assignment::value &&
14 // is_nothrow_move_assignable<allocator_type>::value);
16 // This tests a conforming extension
23 #include "test_macros.h"
24 #include "test_allocator.h"
30 some_alloc(const some_alloc
&);
39 some_alloc2(const some_alloc2
&);
40 void deallocate(void*, unsigned) {}
42 typedef std::false_type propagate_on_container_move_assignment
;
43 typedef std::true_type is_always_equal
;
52 some_alloc3(const some_alloc3
&);
53 void deallocate(void*, unsigned) {}
55 typedef std::false_type propagate_on_container_move_assignment
;
56 typedef std::false_type is_always_equal
;
61 #if defined(_LIBCPP_VERSION)
63 typedef std::vector
<bool> C
;
64 static_assert(std::is_nothrow_move_assignable
<C
>::value
, "");
66 #endif // _LIBCPP_VERSION
68 typedef std::vector
<bool, test_allocator
<bool>> C
;
69 static_assert(!std::is_nothrow_move_assignable
<C
>::value
, "");
71 #if defined(_LIBCPP_VERSION)
73 typedef std::vector
<bool, other_allocator
<bool>> C
;
74 static_assert(std::is_nothrow_move_assignable
<C
>::value
, "");
76 #endif // _LIBCPP_VERSION
79 #if defined(_LIBCPP_VERSION)
80 typedef std::vector
<bool, some_alloc
<bool>> C
;
81 static_assert( std::is_nothrow_move_assignable
<C
>::value
, "");
82 #endif // _LIBCPP_VERSION
84 typedef std::vector
<bool, some_alloc
<bool>> C
;
85 static_assert(!std::is_nothrow_move_assignable
<C
>::value
, "");
89 #if defined(_LIBCPP_VERSION)
90 { // POCMA false, is_always_equal true
91 typedef std::vector
<bool, some_alloc2
<bool>> C
;
92 static_assert( std::is_nothrow_move_assignable
<C
>::value
, "");
94 #endif // _LIBCPP_VERSION
95 { // POCMA false, is_always_equal false
96 typedef std::vector
<bool, some_alloc3
<bool>> C
;
97 static_assert(!std::is_nothrow_move_assignable
<C
>::value
, "");