From f947e2afec9672bda934523d0e6464a8194dea58 Mon Sep 17 00:00:00 2001 From: Desour Date: Mon, 5 Jun 2023 17:08:05 +0200 Subject: [PATCH] Fix some gcc -Wself-move warnings --- src/unittest/test_irrptr.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/unittest/test_irrptr.cpp b/src/unittest/test_irrptr.cpp index 2fb7cfcd6..befeefc73 100644 --- a/src/unittest/test_irrptr.cpp +++ b/src/unittest/test_irrptr.cpp @@ -91,12 +91,14 @@ void TestIrrPtr::testRefCounting() obj->getReferenceCount()); } -#if defined(__clang__) +#if defined(__clang__) || defined(__GNUC__) #pragma GCC diagnostic push #if __clang_major__ >= 7 #pragma GCC diagnostic ignored "-Wself-assign-overloaded" #endif - #pragma GCC diagnostic ignored "-Wself-move" + #if defined(__clang__) || __GNUC__ >= 13 + #pragma GCC diagnostic ignored "-Wself-move" + #endif #endif void TestIrrPtr::testSelfAssignment() @@ -138,6 +140,6 @@ void TestIrrPtr::testNullHandling() UASSERT(!p3); } -#if defined(__clang__) +#if defined(__clang__) || defined(__GNUC__) #pragma GCC diagnostic pop #endif