From e8dc1204a787d5efa27fa093dee70d707cf41da1 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Tue, 30 Jun 2026 14:26:39 +0200 Subject: [PATCH] :white_check_mark: add regression test Signed-off-by: Niels Lohmann --- tests/src/unit-regression2.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/src/unit-regression2.cpp b/tests/src/unit-regression2.cpp index f60b4a277..e6bc34cbf 100644 --- a/tests/src/unit-regression2.cpp +++ b/tests/src/unit-regression2.cpp @@ -66,6 +66,14 @@ using ordered_json = nlohmann::ordered_json; #endif #endif +///////////////////////////////////////////////////////////////////// +// for #4825 - explicitly instantiating basic_json must compile; this +// forces instantiation of binary_writer::write_bjdata_ndarray, whose +// static_cast was ambiguous under explicit instantiation on +// C++17. Merely compiling this translation unit is the regression test. +///////////////////////////////////////////////////////////////////// +template class nlohmann::basic_json<>; + // NLOHMANN_JSON_SERIALIZE_ENUM uses a static std::pair DOCTEST_CLANG_SUPPRESS_WARNING_PUSH DOCTEST_CLANG_SUPPRESS_WARNING("-Wexit-time-destructors")