From 57e9152d9117ffad27f923d7b22b868838323370 Mon Sep 17 00:00:00 2001 From: kevinlul <6320810+kevinlul@users.noreply.github.com> Date: Mon, 1 Jul 2019 17:34:29 -0400 Subject: [PATCH] Correct position of templates relative to header in regression test Thanks @edo9300 https://github.com/nlohmann/json/issues/1642#issuecomment-502617640 --- test/src/unit-regression.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/test/src/unit-regression.cpp b/test/src/unit-regression.cpp index 3dfcef0b8..a2467dc76 100644 --- a/test/src/unit-regression.cpp +++ b/test/src/unit-regression.cpp @@ -33,6 +33,17 @@ DOCTEST_GCC_SUPPRESS_WARNING("-Wfloat-equal") // for some reason including this after the json header leads to linker errors with VS 2017... #include +///////////////////////////////////////////////////////////////////// +// for #1642 +// Must occur BEFORE header include! +///////////////////////////////////////////////////////////////////// +template class array {}; +template class object {}; +template class string {}; +template class number_integer {}; +template class number_unsigned {}; +template class number_float {}; + #define private public #include using nlohmann::json; @@ -1799,13 +1810,3 @@ TEST_CASE("regression tests, exceptions dependent") } } #endif - -///////////////////////////////////////////////////////////////////// -// for #1642 -///////////////////////////////////////////////////////////////////// -template class array {}; -template class object {}; -template class string {}; -template class number_integer {}; -template class number_unsigned {}; -template class number_float {}; \ No newline at end of file