From 2e8a2a4e1c80c7c33bae29b6b3090c6b57617c28 Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Thu, 16 Nov 2023 10:54:20 -0800 Subject: [PATCH] tests: Work around -Wself-move in new gcc We do want to test self-move; fortunately, hiding the object reference behind a separate pointer variable silences the warning. --- tests/test_xpath_api.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/test_xpath_api.cpp b/tests/test_xpath_api.cpp index 8687e35..1dbb13c 100644 --- a/tests/test_xpath_api.cpp +++ b/tests/test_xpath_api.cpp @@ -573,7 +573,8 @@ TEST_XML(xpath_api_nodeset_move_assign_self, "") test_runner::_memory_fail_threshold = 1; - set = std::move(*&set); + xpath_node_set* self = &set; + set = std::move(*self); } TEST(xpath_api_query_move) @@ -614,7 +615,8 @@ TEST(xpath_api_query_move) CHECK(q4); CHECK(q4.evaluate_boolean(c)); - q4 = std::move(*&q4); + xpath_query* q4self = &q4; + q4 = std::move(*q4self); CHECK(q4); CHECK(q4.evaluate_boolean(c));