[RISCV] Fix mgather -> riscv.masked.strided.load combine not extending indices (...
[llvm-project.git] / libcxx / test / std / containers / sequences / vector.bool / move_noexcept.pass.cpp
blobccd8185d3f3d665018ab10ec4edad38f6c2a9e46
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 // <vector>
11 // vector(vector&&)
12 // noexcept(is_nothrow_move_constructible<allocator_type>::value);
14 // This tests a conforming extension
16 // UNSUPPORTED: c++03
18 #include <vector>
19 #include <cassert>
21 #include "test_macros.h"
22 #include "test_allocator.h"
24 template <class T>
25 struct some_alloc
27 typedef T value_type;
28 some_alloc(const some_alloc&);
31 int main(int, char**)
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
49 #if TEST_STD_VER > 14
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
54 #else
55 typedef std::vector<bool, some_alloc<bool>> C;
56 static_assert(!std::is_nothrow_move_constructible<C>::value, "");
57 #endif
60 return 0;