summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/auto/corelib/io/qurlquery/tst_qurlquery.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/auto/corelib/io/qurlquery/tst_qurlquery.cpp b/tests/auto/corelib/io/qurlquery/tst_qurlquery.cpp
index 4735d33eb26..2ff1ba43ae4 100644
--- a/tests/auto/corelib/io/qurlquery/tst_qurlquery.cpp
+++ b/tests/auto/corelib/io/qurlquery/tst_qurlquery.cpp
@@ -190,11 +190,17 @@ void tst_QUrlQuery::constructing()
QCOMPARE(moved, copy);
// self move-assign
- moved = std::move(moved);
+ {
+ auto &self = moved; // prevent -Wself-move
+ moved = std::move(self);
+ }
QCOMPARE(moved, copy);
// self move-assign of moved-from (Hinnant Criterion)
- other = std::move(other);
+ {
+ auto &self = other; // prevent -Wself-move
+ other = std::move(self);
+ }
// shouldn't crash; here, or further down
// copy-assign to moved-from object