aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlpropertycache_p.h
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2023-06-26 10:25:00 +0200
committerMarc Mutz <marc.mutz@qt.io>2023-06-26 14:23:23 +0000
commitef9fe5d61ce7645f2195c229a7dcef3a74ecf6dd (patch)
treeea70847ce3e1983a2ca945261c7e698b2d0f4b78 /src/qml/qml/qqmlpropertycache_p.h
parentcb55777639a73f8d963ce63d6ae06a1bf9c1e1b6 (diff)
Div. smart pointer/raii classes: mark ctors [[nodiscard]]
The following classes are smart pointers or RAII classes, whose ctors QUIP-0019 asks to mark as [[nodiscard]]: - QQmlMetaObjectPointer - QQuickDeferredPointer - QuitLockDisabler QUIP: QUIP-0019 Fixes: QTBUG-104168 Pick-to: 6.6 Change-Id: Ia362f5d0eab7376f4536aefc61c31ceb296b1cc2 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlpropertycache_p.h')
-rw-r--r--src/qml/qml/qqmlpropertycache_p.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/qml/qml/qqmlpropertycache_p.h b/src/qml/qml/qqmlpropertycache_p.h
index b261d1caca..a06a1b6e39 100644
--- a/src/qml/qml/qqmlpropertycache_p.h
+++ b/src/qml/qml/qqmlpropertycache_p.h
@@ -40,9 +40,9 @@ class QQmlVMEMetaObject;
class QQmlMetaObjectPointer
{
public:
- QQmlMetaObjectPointer() = default;
+ Q_NODISCARD_CTOR QQmlMetaObjectPointer() = default;
- QQmlMetaObjectPointer(const QMetaObject *staticMetaObject)
+ Q_NODISCARD_CTOR QQmlMetaObjectPointer(const QMetaObject *staticMetaObject)
: d(quintptr(staticMetaObject))
{
Q_ASSERT((d.loadRelaxed() & Shared) == 0);
@@ -57,7 +57,7 @@ public:
private:
friend class QQmlPropertyCache;
- QQmlMetaObjectPointer(const QQmlMetaObjectPointer &other)
+ Q_NODISCARD_CTOR QQmlMetaObjectPointer(const QQmlMetaObjectPointer &other)
: d(other.d.loadRelaxed())
{
// other has to survive until this ctor is done. So d cannot disappear before.