From ac15f907be14ce070a99d0c719aa8bcdb14de6b0 Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Fri, 6 Feb 2026 15:45:40 +0300 Subject: [PATCH] Fix warnings about missing sized deallocation operator in C++14 mode. --- test/threads/thread/constr/FArgs_pass.cpp | 18 ++++++++++++++++++ test/threads/thread/constr/F_pass.cpp | 18 ++++++++++++++++++ test/threads/thread/constr/lambda_pass.cpp | 18 ++++++++++++++++++ 3 files changed, 54 insertions(+) diff --git a/test/threads/thread/constr/FArgs_pass.cpp b/test/threads/thread/constr/FArgs_pass.cpp index cfee1390..6de724de 100644 --- a/test/threads/thread/constr/FArgs_pass.cpp +++ b/test/threads/thread/constr/FArgs_pass.cpp @@ -18,10 +18,12 @@ // template thread(F f, Args... args); #include +#include #include #include #include #include +#include unsigned throw_one = 0xFFFF; @@ -51,6 +53,22 @@ void operator delete(void* p) BOOST_NOEXCEPT_OR_NOTHROW std::free(p); } +#if (defined(__cpp_sized_deallocation) && (__cpp_sized_deallocation >= 201309l)) || \ + (BOOST_CXX_VERSION > 201103l && \ + (defined(__GNUC__) && (__GNUC__ >= 5)) || \ + (defined(__clang__) && (__clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 4))) || \ + (defined(BOOST_MSVC) && (_MSC_VER >= 1900)) \ + ) +#if defined BOOST_MSVC +void operator delete(void* p, std::size_t) +#else +void operator delete(void* p, std::size_t) BOOST_NOEXCEPT_OR_NOTHROW +#endif +{ + operator delete(p); +} +#endif + bool f_run = false; void f(int i, double j) diff --git a/test/threads/thread/constr/F_pass.cpp b/test/threads/thread/constr/F_pass.cpp index 43827226..ee405394 100644 --- a/test/threads/thread/constr/F_pass.cpp +++ b/test/threads/thread/constr/F_pass.cpp @@ -18,10 +18,12 @@ // template thread(F f, Args... args); #include +#include #include #include #include #include +#include unsigned throw_one = 0xFFFF; @@ -51,6 +53,22 @@ void operator delete(void* p) BOOST_NOEXCEPT_OR_NOTHROW std::free(p); } +#if (defined(__cpp_sized_deallocation) && (__cpp_sized_deallocation >= 201309l)) || \ + (BOOST_CXX_VERSION > 201103l && \ + (defined(__GNUC__) && (__GNUC__ >= 5)) || \ + (defined(__clang__) && (__clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 4))) || \ + (defined(BOOST_MSVC) && (_MSC_VER >= 1900)) \ + ) +#if defined BOOST_MSVC +void operator delete(void* p, std::size_t) +#else +void operator delete(void* p, std::size_t) BOOST_NOEXCEPT_OR_NOTHROW +#endif +{ + operator delete(p); +} +#endif + bool f_run = false; void f() diff --git a/test/threads/thread/constr/lambda_pass.cpp b/test/threads/thread/constr/lambda_pass.cpp index 38742f53..d5af13f2 100644 --- a/test/threads/thread/constr/lambda_pass.cpp +++ b/test/threads/thread/constr/lambda_pass.cpp @@ -18,10 +18,12 @@ // template thread(Clousure f); #include +#include #include #include #include #include +#include #if ! defined BOOST_NO_CXX11_LAMBDAS @@ -51,6 +53,22 @@ void operator delete(void* p) BOOST_NOEXCEPT_OR_NOTHROW std::free(p); } +#if (defined(__cpp_sized_deallocation) && (__cpp_sized_deallocation >= 201309l)) || \ + (BOOST_CXX_VERSION > 201103l && \ + (defined(__GNUC__) && (__GNUC__ >= 5)) || \ + (defined(__clang__) && (__clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 4))) || \ + (defined(BOOST_MSVC) && (_MSC_VER >= 1900)) \ + ) +#if defined BOOST_MSVC +void operator delete(void* p, std::size_t) +#else +void operator delete(void* p, std::size_t) BOOST_NOEXCEPT_OR_NOTHROW +#endif +{ + operator delete(p); +} +#endif + bool f_run = false; int main()