From 336c80848543b13af2f3392f1c030df025054621 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Mon, 5 Oct 2026 13:49:28 +0200 Subject: [PATCH] Skip the #5650 allocator test on MSVC 2015 debug builds MSVC 2015's debug STL constructs the containers' debug proxies through the allocator in noexcept constructors, so countdown_allocator's failing construction crashes test-allocator (SIGSEGV) instead of throwing std::bad_alloc. Use the guard #5585 uses for the same reason. Signed-off-by: Niels Lohmann --- tests/src/unit-allocator.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/src/unit-allocator.cpp b/tests/src/unit-allocator.cpp index bc283ab28..a358e75f9 100644 --- a/tests/src/unit-allocator.cpp +++ b/tests/src/unit-allocator.cpp @@ -521,6 +521,10 @@ struct countdown_allocator : std::allocator TEST_CASE("converting a deeply nested value from another specialization fails cleanly (#5650)") { + // MSVC 2015's debug STL constructs the containers' debug proxies through + // the allocator in noexcept constructors, so a failing construction crashes + // the program there instead of throwing std::bad_alloc. Nothing to check. +#if !(defined(_MSC_VER) && _MSC_VER < 1910 && defined(_ITERATOR_DEBUG_LEVEL) && _ITERATOR_DEBUG_LEVEL > 0) using countdown_json = nlohmann::basic_json 0); +#endif } namespace