mirror of
https://github.com/nlohmann/json.git
synced 2026-10-11 17:07:15 +00:00
Silence a clang-tidy use-after-move finding in the json_view test
const_text is const, so std::move does not move from it; the second call is part of the const rvalue test. Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
1 file changed
+1
-1
@@ -366,7 +366,7 @@ TEST_CASE("json_view")
|
|||||||
CHECK(from_const_rvalue.source().data() != const_text.data()); // NOLINT(bugprone-use-after-move,hicpp-invalid-access-moved): const, not moved from
|
CHECK(from_const_rvalue.source().data() != const_text.data()); // NOLINT(bugprone-use-after-move,hicpp-invalid-access-moved): const, not moved from
|
||||||
CHECK(from_const_rvalue.root().materialize() == expected);
|
CHECK(from_const_rvalue.root().materialize() == expected);
|
||||||
json_document read_const_rvalue;
|
json_document read_const_rvalue;
|
||||||
read_const_rvalue.read(std::move(const_text)); // NOLINT(performance-move-const-arg,hicpp-move-const-arg)
|
read_const_rvalue.read(std::move(const_text)); // NOLINT(performance-move-const-arg,hicpp-move-const-arg,bugprone-use-after-move,hicpp-invalid-access-moved)
|
||||||
CHECK(read_const_rvalue.owns_source());
|
CHECK(read_const_rvalue.owns_source());
|
||||||
CHECK(read_const_rvalue.root().materialize() == expected);
|
CHECK(read_const_rvalue.root().materialize() == expected);
|
||||||
const std::vector<char> const_chars(text.begin(), text.end());
|
const std::vector<char> const_chars(text.begin(), text.end());
|
||||||
|
|||||||
Reference in new issue
Block a user