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")