Silence -Wself-assign-overloaded with clang

This commit is contained in:
Vlad Zahorodnii 2022-01-21 13:47:06 +02:00
parent 59b21a0130
commit b0af657821

View file

@ -155,11 +155,15 @@ void TestXcbWrapper::assignementEmpty()
testEmpty(geometry); testEmpty(geometry);
testEmpty(other); testEmpty(other);
QVERIFY(!other.isRetrieved()); QVERIFY(!other.isRetrieved());
QT_WARNING_PUSH
QT_WARNING_DISABLE_CLANG("-Wself-assign-overloaded")
// test assignment to self // test assignment to self
geometry = geometry; geometry = geometry;
other = other; other = other;
testEmpty(geometry); testEmpty(geometry);
testEmpty(other); testEmpty(other);
QT_WARNING_POP
} }
void TestXcbWrapper::assignmentBeforeRetrieve() void TestXcbWrapper::assignmentBeforeRetrieve()
@ -177,10 +181,14 @@ void TestXcbWrapper::assignmentBeforeRetrieve()
QCOMPARE(other.window(), (xcb_window_t)m_testWindow); QCOMPARE(other.window(), (xcb_window_t)m_testWindow);
other = WindowGeometry(); other = WindowGeometry();
testEmpty(geometry); testEmpty(geometry);
QT_WARNING_PUSH
QT_WARNING_DISABLE_CLANG("-Wself-assign-overloaded")
// test assignment to self // test assignment to self
geometry = geometry; geometry = geometry;
other = other; other = other;
testEmpty(geometry); testEmpty(geometry);
QT_WARNING_POP
} }
void TestXcbWrapper::assignmentAfterRetrieve() void TestXcbWrapper::assignmentAfterRetrieve()
@ -194,11 +202,14 @@ void TestXcbWrapper::assignmentAfterRetrieve()
QVERIFY(other.isRetrieved()); QVERIFY(other.isRetrieved());
testGeometry(other, QRect(0, 0, 10, 10)); testGeometry(other, QRect(0, 0, 10, 10));
QT_WARNING_PUSH
QT_WARNING_DISABLE_CLANG("-Wself-assign-overloaded")
// test assignment to self // test assignment to self
geometry = geometry; geometry = geometry;
other = other; other = other;
testEmpty(geometry); testEmpty(geometry);
testGeometry(other, QRect(0, 0, 10, 10)); testGeometry(other, QRect(0, 0, 10, 10));
QT_WARNING_POP
// set to empty again // set to empty again
other = WindowGeometry(); other = WindowGeometry();