File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed
std/containers/sequences/vector.bool Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ int main(int, char**) {
101
101
try { // Throw in vector(const vector&, const allocator_type&) from allocator
102
102
throwing_allocator<bool > alloc (false , false );
103
103
AllocVec vec (alloc);
104
- vec.emplace_back (true );
104
+ vec.push_back (true );
105
105
alloc.throw_on_copy_ = true ;
106
106
AllocVec vec2 (vec, alloc);
107
107
} catch (int ) {
@@ -111,7 +111,7 @@ int main(int, char**) {
111
111
try { // Throw in vector(vector&&, const allocator_type&) from allocator
112
112
throwing_allocator<bool > alloc (false , false );
113
113
AllocVec vec (alloc);
114
- vec.emplace_back (true );
114
+ vec.push_back (true );
115
115
alloc.throw_on_copy_ = true ;
116
116
AllocVec vec2 (std::move (vec), alloc);
117
117
} catch (int ) {
Original file line number Diff line number Diff line change 6
6
//
7
7
// ===----------------------------------------------------------------------===//
8
8
9
- #ifndef EXCEPTION_TEST_HELPER_H
10
- #define EXCEPTION_TEST_HELPER_H
9
+ #ifndef EXCEPTION_TEST_HELPERS_H
10
+ #define EXCEPTION_TEST_HELPERS_H
11
11
12
12
#include " count_new.h"
13
13
@@ -23,6 +23,11 @@ struct throwing_allocator {
23
23
throw 0 ;
24
24
}
25
25
26
+ throwing_allocator (const throwing_allocator& rhs) : throw_on_copy_(rhs.throw_on_copy_) {
27
+ if (throw_on_copy_)
28
+ throw 0 ;
29
+ }
30
+
26
31
template <class U >
27
32
throwing_allocator (const throwing_allocator<U>& rhs) : throw_on_copy_(rhs.throw_on_copy_) {
28
33
if (throw_on_copy_)
@@ -79,4 +84,4 @@ inline void check_new_delete_called() {
79
84
assert (globalMemCounter.aligned_new_array_called == globalMemCounter.aligned_delete_array_called );
80
85
}
81
86
82
- #endif // EXCEPTION_TEST_HELPER_H
87
+ #endif // EXCEPTION_TEST_HELPERS_H
You can’t perform that action at this time.
0 commit comments