From 7960f33af84d7bdf817d934c4509c6850f1df8f1 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Sat, 7 Nov 2026 09:08:24 +0000 Subject: [PATCH] Fix CI: astyle and clang-tidy for sweep_allocator::construct() astyle 3.4.13 reformats the enable_if default template argument (Check amalgamation). Delete the const overload instead, which makes the libc++ probe for const objects fail in the SFINAE context just the same and needs no . Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01N5NasEsrzHhSNouxSoEwqz Signed-off-by: Niels Lohmann --- tests/src/unit-allocator.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/src/unit-allocator.cpp b/tests/src/unit-allocator.cpp index 3c719bf26..9862e8c5e 100644 --- a/tests/src/unit-allocator.cpp +++ b/tests/src/unit-allocator.cpp @@ -14,7 +14,6 @@ using nlohmann::json; #include #include -#include #include #if JSON_HAS_RANGES #include @@ -1074,14 +1073,17 @@ struct sweep_allocator return (std::numeric_limits::max)() / sizeof(T); } - // libc++ probes whether construct() is usable for const objects (when - // checking for trivial copies); this must not be viable then - template::value>::type> + template void construct(U* p, Args&& ... args) noexcept(noexcept(::new (static_cast(p)) U(std::forward(args)...))) { ::new (static_cast(p)) U(std::forward(args)...); } + // libc++ probes whether construct() is usable for const objects (when + // checking for trivial copies); this must not be viable then + template + void construct(const U* /*unused*/, const Args& ... /*unused*/) = delete; + template void destroy(U* p) noexcept {