mirror of
https://github.com/nlohmann/json.git
synced 2026-03-05 00:36:28 +00:00
@@ -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>>();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user