From 0ae7624c146e6fab29d79cb6f75ff0d895f35ce5 Mon Sep 17 00:00:00 2001 From: Navin P Date: Mon, 6 Mar 2023 11:15:27 +0530 Subject: [PATCH] gcc-13 rebind compile failure fix. Adding struct rebind for custom allocators as per this thread https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72792#c7 --- tests/src/unit-allocator.cpp | 5 +++++ tests/src/unit-regression2.cpp | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/tests/src/unit-allocator.cpp b/tests/src/unit-allocator.cpp index 76e3b03f1..ee9702295 100644 --- a/tests/src/unit-allocator.cpp +++ b/tests/src/unit-allocator.cpp @@ -20,6 +20,11 @@ struct bad_allocator : std::allocator { using std::allocator::allocator; + template + struct rebind { + using other = bad_allocator; + }; + template void construct(T* /*unused*/, Args&& ... /*unused*/) { diff --git a/tests/src/unit-regression2.cpp b/tests/src/unit-regression2.cpp index 2bb9b32e5..454e8d7a8 100644 --- a/tests/src/unit-regression2.cpp +++ b/tests/src/unit-regression2.cpp @@ -187,6 +187,11 @@ std::string* sax_no_exception::error_string = nullptr; template class my_allocator : public std::allocator { + template + struct rebind { + using other = my_allocator; + }; + public: using std::allocator::allocator; };