[PowerPC][NFC] Cleanup PPCCTRLoopsVerify pass
[llvm-project.git] / libcxx / test / std / containers / sequences / vector.bool / default_noexcept.pass.cpp
bloba43b6483b0535b1fb32fda46678f1b4244f1f7a3
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 //===----------------------------------------------------------------------===//
8 // UNSUPPORTED: c++03
10 // <vector>
12 // vector<bool>()
13 // noexcept(is_nothrow_default_constructible<allocator_type>::value);
15 // This tests a conforming extension
16 // For vector<>, this was added to the standard by N4258,
17 // but vector<bool> was not changed.
20 #include <vector>
21 #include <cassert>
23 #include "test_macros.h"
24 #include "test_allocator.h"
26 template <class T>
27 struct some_alloc
29 typedef T value_type;
30 some_alloc(const some_alloc&);
33 int main(int, char**)
35 #if defined(_LIBCPP_VERSION)
37 typedef std::vector<bool> C;
38 static_assert(std::is_nothrow_default_constructible<C>::value, "");
41 typedef std::vector<bool, test_allocator<bool>> C;
42 static_assert(std::is_nothrow_default_constructible<C>::value, "");
45 typedef std::vector<bool, other_allocator<bool>> C;
46 static_assert(!std::is_nothrow_default_constructible<C>::value, "");
49 typedef std::vector<bool, some_alloc<bool>> C;
50 static_assert(!std::is_nothrow_default_constructible<C>::value, "");
52 #endif // _LIBCPP_VERSION
54 return 0;