aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Solovev <ivan.solovev@qt.io>2023-08-17 18:20:30 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-08-22 08:37:36 +0000
commit368391b69f216b800b198e9c6ad99619e8e9fe83 (patch)
tree85d0a3a12afb03e7b8417272951fb03792f857c4
parentf751745dac2ff8d213e2b05bb9d0848cc90c905a (diff)
Use Q_DECL_UNUSED_MEMBER for unused private class members
Unlike plain [[maybe_unused]], this macro does not generate new warnings, so we do not need the QT_WARNING_{PUSH,POP} magic. This commit replaces 32b49e1a3889f825a88b18b00eca045d5758f12a. Found during Qt 6.6 API review, but picking down to 6.5, as the original change was picked to 6.5 as well. Change-Id: I0355eb1266338aefeb0e800bb41eda5c67461295 Reviewed-by: Marc Mutz <marc.mutz@qt.io> (cherry picked from commit 5cdd7fa66203808e3adcf48386fa0aea0d525889) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/qml/qml/qqmlcontextdata_p.h5
-rw-r--r--src/quick/scenegraph/coreapi/qsgnode.h7
2 files changed, 3 insertions, 9 deletions
diff --git a/src/qml/qml/qqmlcontextdata_p.h b/src/qml/qml/qqmlcontextdata_p.h
index c74e043b47..a0202eb1ba 100644
--- a/src/qml/qml/qqmlcontextdata_p.h
+++ b/src/qml/qml/qqmlcontextdata_p.h
@@ -362,10 +362,7 @@ private:
quint32 m_ownedByParent:1;
quint32 m_ownedByPublicContext:1;
quint32 m_hasExtraObject:1; // used in QQmlDelegateModelItem::dataForObject to find the corresponding QQmlDelegateModelItem of an object
- QT_WARNING_PUSH
- QT_WARNING_DISABLE_GCC("-Wattributes")
- [[maybe_unused]] quint32 m_dummy:23;
- QT_WARNING_POP
+ Q_DECL_UNUSED_MEMBER quint32 m_dummy:23;
QQmlContext *m_publicContext = nullptr;
union {
diff --git a/src/quick/scenegraph/coreapi/qsgnode.h b/src/quick/scenegraph/coreapi/qsgnode.h
index 4655c6bd1d..50dc6021ea 100644
--- a/src/quick/scenegraph/coreapi/qsgnode.h
+++ b/src/quick/scenegraph/coreapi/qsgnode.h
@@ -175,11 +175,8 @@ private:
QSGGeometry *m_geometry;
- QT_WARNING_PUSH
- QT_WARNING_DISABLE_GCC("-Wattributes")
- [[maybe_unused]] int m_reserved_start_index;
- [[maybe_unused]] int m_reserved_end_index;
- QT_WARNING_POP
+ Q_DECL_UNUSED_MEMBER int m_reserved_start_index;
+ Q_DECL_UNUSED_MEMBER int m_reserved_end_index;
const QMatrix4x4 *m_matrix;
const QSGClipNode *m_clip_list;