MessagePack tests: assign the parsed value instead of casting it to void
GCC (ci_test_gcc) reports -Werror=unused-result for static_cast<void>(json::from_msgpack(...)): a cast to void does not silence warn_unused_result on GCC. Assign to a json, as the other tests in the file do. Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
1 file changed
+4
-2
@@ -2275,7 +2275,8 @@ TEST_CASE("MessagePack arrays of scalars from contiguous and non-contiguous inpu
|
||||
std::string bytewise_error;
|
||||
try
|
||||
{
|
||||
static_cast<void>(json::from_msgpack(contiguous));
|
||||
json _;
|
||||
_ = json::from_msgpack(contiguous);
|
||||
}
|
||||
catch (const json::parse_error& e)
|
||||
{
|
||||
@@ -2283,7 +2284,8 @@ TEST_CASE("MessagePack arrays of scalars from contiguous and non-contiguous inpu
|
||||
}
|
||||
try
|
||||
{
|
||||
static_cast<void>(json::from_msgpack(bytewise.begin(), bytewise.end()));
|
||||
json _;
|
||||
_ = json::from_msgpack(bytewise.begin(), bytewise.end());
|
||||
}
|
||||
catch (const json::parse_error& e)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user