parent
e426219256
commit
11fecc25af
3 changed files with 33 additions and 8 deletions
|
|
@ -33,6 +33,14 @@ SOFTWARE.
|
|||
#include <nlohmann/json.hpp>
|
||||
using nlohmann::json;
|
||||
|
||||
#if (defined(__cplusplus) && __cplusplus >= 201703L) || (defined(_HAS_CXX17) && _HAS_CXX17 == 1) // fix for issue #464
|
||||
#define JSON_HAS_CPP_17
|
||||
#endif
|
||||
|
||||
#ifdef JSON_HAS_CPP_17
|
||||
#include <variant>
|
||||
#endif
|
||||
|
||||
#include "fifo_map.hpp"
|
||||
|
||||
#include <fstream>
|
||||
|
|
@ -1649,4 +1657,12 @@ TEST_CASE("regression tests")
|
|||
|
||||
CHECK(diffs.size() == 1); // Note the change here, was 2
|
||||
}
|
||||
|
||||
#ifdef JSON_HAS_CPP_17
|
||||
SECTION("issue #1292 - Serializing std::variant causes stack overflow")
|
||||
{
|
||||
static_assert(
|
||||
not std::is_constructible<json, std::variant<int, float>>::value, "");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue