mirror of
https://github.com/nlohmann/json.git
synced 2026-02-24 20:36:27 +00:00
Fix assertion failure for JSON_DIAGNOSTICS (#3037)
* Fix assertion failure #3032
This commit is contained in:
@@ -234,4 +234,21 @@ TEST_CASE("Better diagnostics")
|
||||
root.push_back(lower);
|
||||
}
|
||||
}
|
||||
|
||||
SECTION("Regression test for https://github.com/nlohmann/json/issues/3032")
|
||||
{
|
||||
// reference operator[](size_type idx)
|
||||
{
|
||||
json j_arr = json::array();
|
||||
j_arr[0] = 0;
|
||||
j_arr[1] = 1;
|
||||
j_arr[2] = 2;
|
||||
j_arr[3] = 3;
|
||||
j_arr[4] = 4;
|
||||
j_arr[5] = 5;
|
||||
j_arr[6] = 6;
|
||||
j_arr[7] = 7;
|
||||
json j_arr_copy = j_arr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user