parent
b02e3bb0b6
commit
01d6118828
4 changed files with 46 additions and 12 deletions
|
@ -316,8 +316,8 @@ TEST_CASE("object inspection")
|
|||
SECTION("round trips")
|
||||
{
|
||||
for (const auto& s :
|
||||
{"3.141592653589793", "1000000000000000010E5"
|
||||
})
|
||||
{"3.141592653589793", "1000000000000000010E5"
|
||||
})
|
||||
{
|
||||
json j1 = json::parse(s);
|
||||
std::string s1 = j1.dump();
|
||||
|
|
|
@ -711,3 +711,25 @@ TEST_CASE("an incomplete type does not trigger a compiler error in non-evaluated
|
|||
{
|
||||
static_assert(not is_constructible_patched<json, incomplete>::value, "");
|
||||
}
|
||||
|
||||
namespace
|
||||
{
|
||||
class Evil
|
||||
{
|
||||
public:
|
||||
Evil() = default;
|
||||
template <typename T>
|
||||
Evil(T) {}
|
||||
};
|
||||
|
||||
void from_json(const json&, Evil&) {}
|
||||
}
|
||||
|
||||
TEST_CASE("Issue #924")
|
||||
{
|
||||
// Prevent get<std::vector<Evil>>() to throw
|
||||
auto j = json::array();
|
||||
|
||||
(void) j.get<Evil>();
|
||||
(void) j.get<std::vector<Evil>>();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue