From d1a15e5ff8bca4fd38c9a5b89348ed40f51fe22e Mon Sep 17 00:00:00 2001 From: FyiurAmron Date: Tue, 28 May 2024 22:39:38 +0200 Subject: [PATCH] Fix for Werror=self-move in test for GCC >= 13 (#7288) --- tests/src/core/ArrayVectorTest.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/src/core/ArrayVectorTest.cpp b/tests/src/core/ArrayVectorTest.cpp index 1eba265e9..9e6ed40b8 100644 --- a/tests/src/core/ArrayVectorTest.cpp +++ b/tests/src/core/ArrayVectorTest.cpp @@ -226,9 +226,17 @@ private slots: { { // Self-assignment should not change the contents + //// Please note the following: + //// https://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2468 + //// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81159 auto v = ArrayVector{1, 2, 3}; const auto oldValue = v; +#pragma GCC diagnostic push +#if __GNUC__ >= 13 +# pragma GCC diagnostic ignored "-Wself-move" +#endif v = std::move(v); +#pragma GCC diagnostic pop QCOMPARE(v, oldValue); } {