From 575be1a7fe775f8165188879a8ec8a0cd65a732d Mon Sep 17 00:00:00 2001 From: Florian Albrechtskirchinger Date: Sat, 5 Mar 2022 10:21:13 +0100 Subject: [PATCH] Fix custom allocator test build failures (C++20) Allocator tests fail to compile in C++20 mode with clang+MS STL due to missing copy constructors. --- test/src/unit-allocator.cpp | 2 ++ test/src/unit-regression2.cpp | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/test/src/unit-allocator.cpp b/test/src/unit-allocator.cpp index 2671212f5..268ae54df 100644 --- a/test/src/unit-allocator.cpp +++ b/test/src/unit-allocator.cpp @@ -39,6 +39,8 @@ namespace template struct bad_allocator : std::allocator { + using std::allocator::allocator; + template void construct(T* /*unused*/, Args&& ... /*unused*/) { diff --git a/test/src/unit-regression2.cpp b/test/src/unit-regression2.cpp index 52db3589c..7c466b0b3 100644 --- a/test/src/unit-regression2.cpp +++ b/test/src/unit-regression2.cpp @@ -271,7 +271,10 @@ std::string* sax_no_exception::error_string = nullptr; template class my_allocator : public std::allocator -{}; +{ + public: + using std::allocator::allocator; +}; ///////////////////////////////////////////////////////////////////// // for #3077