Skip to content

Commit 6de0052

Browse files
committed
Run clang-format
1 parent e55a7a1 commit 6de0052

File tree

2 files changed

+20
-12
lines changed

2 files changed

+20
-12
lines changed

libcxx/test/std/containers/sequences/vector.bool/exceptions.pass.cpp

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,20 @@
2020

2121
int main(int, char**) {
2222
using AllocVec = std::vector<bool, throwing_allocator<bool> >;
23-
try { // Throw in vector() from allocator
23+
try { // Throw in vector() from allocator
2424
AllocVec vec; // Throw on default construction
2525
} catch (int) {
2626
}
2727
check_new_delete_called();
2828

29-
#if TEST_STD_VER >= 14
30-
try { // Throw in vector(size_type, const allocator_type&) from allocator
29+
#if TEST_STD_VER >= 14
30+
try { // Throw in vector(size_type, const allocator_type&) from allocator
3131
throwing_allocator<bool> alloc(false, true); // Throw on copy only
3232
AllocVec get_alloc(0, alloc);
3333
} catch (int) {
3434
}
3535
check_new_delete_called();
36-
#endif // TEST_STD_VER >= 14
36+
#endif // TEST_STD_VER >= 14
3737

3838
try { // Throw in vector(size_type, const value_type&, const allocator_type&) from allocator
3939
throwing_allocator<bool> alloc(false, true); // Throw on copy only
@@ -43,34 +43,40 @@ int main(int, char**) {
4343
check_new_delete_called();
4444

4545
try { // Throw in vector(InputIterator, InputIterator) from input iterator
46-
std::vector<bool> vec((throwing_iterator<bool, std::input_iterator_tag>()), throwing_iterator<bool, std::input_iterator_tag>(2));
46+
std::vector<bool> vec(
47+
(throwing_iterator<bool, std::input_iterator_tag>()), throwing_iterator<bool, std::input_iterator_tag>(2));
4748
} catch (int) {
4849
}
4950
check_new_delete_called();
5051

5152
try { // Throw in vector(InputIterator, InputIterator) from forward iterator
52-
std::vector<bool> vec((throwing_iterator<bool, std::forward_iterator_tag>()), throwing_iterator<bool, std::forward_iterator_tag>(2));
53+
std::vector<bool> vec(
54+
(throwing_iterator<bool, std::forward_iterator_tag>()), throwing_iterator<bool, std::forward_iterator_tag>(2));
5355
} catch (int) {
5456
}
5557
check_new_delete_called();
5658

5759
try { // Throw in vector(InputIterator, InputIterator) from allocator
5860
bool a[] = {true, true};
59-
AllocVec vec(cpp17_input_iterator<bool*>(a), cpp17_input_iterator<bool*>(a + 2)); // throwing_allocator throws on default construction
61+
AllocVec vec(cpp17_input_iterator<bool*>(a),
62+
cpp17_input_iterator<bool*>(a + 2)); // throwing_allocator throws on default construction
6063
} catch (int) {
6164
}
6265
check_new_delete_called();
6366

6467
try { // Throw in vector(InputIterator, InputIterator, const allocator_type&) from input iterator
6568
std::allocator<bool> alloc;
66-
std::vector<bool> vec(throwing_iterator<bool, std::input_iterator_tag>(), throwing_iterator<bool, std::input_iterator_tag>(2), alloc);
69+
std::vector<bool> vec(
70+
throwing_iterator<bool, std::input_iterator_tag>(), throwing_iterator<bool, std::input_iterator_tag>(2), alloc);
6771
} catch (int) {
6872
}
6973
check_new_delete_called();
7074

7175
try { // Throw in vector(InputIterator, InputIterator, const allocator_type&) from forward iterator
7276
std::allocator<bool> alloc;
73-
std::vector<bool> vec(throwing_iterator<bool, std::forward_iterator_tag>(), throwing_iterator<bool, std::forward_iterator_tag>(2), alloc);
77+
std::vector<bool> vec(throwing_iterator<bool, std::forward_iterator_tag>(),
78+
throwing_iterator<bool, std::forward_iterator_tag>(2),
79+
alloc);
7480
} catch (int) {
7581
}
7682
check_new_delete_called();
@@ -79,7 +85,7 @@ int main(int, char**) {
7985
bool a[] = {true, true};
8086
throwing_allocator<bool> alloc(false, true); // Throw on copy only
8187
AllocVec vec(cpp17_input_iterator<bool*>(a), cpp17_input_iterator<bool*>(a + 2), alloc);
82-
} catch (int) {
88+
} catch (int) {
8389
}
8490
check_new_delete_called();
8591

libcxx/test/support/exception_test_helpers.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ struct throwing_allocator {
1616
using value_type = T;
1717
using is_always_equal = std::false_type;
1818

19-
bool throw_on_copy_ = false;
19+
bool throw_on_copy_ = false;
2020

2121
throwing_allocator(bool throw_on_ctor = true, bool throw_on_copy = false) : throw_on_copy_(throw_on_copy) {
2222
if (throw_on_ctor)
@@ -33,7 +33,9 @@ struct throwing_allocator {
3333
void deallocate(T* ptr, std::size_t n) { std::allocator<T>().deallocate(ptr, n); }
3434

3535
template <class U>
36-
friend bool operator==(const throwing_allocator&, const throwing_allocator<U>&) { return true; }
36+
friend bool operator==(const throwing_allocator&, const throwing_allocator<U>&) {
37+
return true;
38+
}
3739
};
3840

3941
template <class T, class IterCat>

0 commit comments

Comments
 (0)