diff --git a/tests/src/unit-allocator.cpp b/tests/src/unit-allocator.cpp index 76e3b03f1..f2e63552a 100644 --- a/tests/src/unit-allocator.cpp +++ b/tests/src/unit-allocator.cpp @@ -20,11 +20,20 @@ struct bad_allocator : std::allocator { using std::allocator::allocator; + bad_allocator() = default; + template bad_allocator(const bad_allocator& /*unused*/) { } + template void construct(T* /*unused*/, Args&& ... /*unused*/) { throw std::bad_alloc(); } + + template + struct rebind + { + using other = bad_allocator; + }; }; } // namespace diff --git a/tests/src/unit-regression2.cpp b/tests/src/unit-regression2.cpp index 2bb9b32e5..dbafb436b 100644 --- a/tests/src/unit-regression2.cpp +++ b/tests/src/unit-regression2.cpp @@ -189,6 +189,15 @@ class my_allocator : public std::allocator { public: using std::allocator::allocator; + + my_allocator() = default; + template my_allocator(const my_allocator& /*unused*/) { } + + template + struct rebind + { + using other = my_allocator; + }; }; /////////////////////////////////////////////////////////////////////