From 147ad81c1fc8886123acf184596525f26aac7f33 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Sun, 16 Jul 2023 14:24:43 +0200 Subject: [PATCH] SlotObjectGuard: mark ctor nodiscard MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QUIP: 19 Change-Id: Idaf8cda12fe2ca97a763d78ff4c8cd7304d178e5 Reviewed-by: MÃ¥rten Nordheim Reviewed-by: Volker Hilsheimer (cherry picked from commit 3a166fa45ddd4435c15b94a8c9c77871c0aae43d) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/kernel/qobject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index b745e24f1d5..a75d053bf0f 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -3762,7 +3762,7 @@ struct SlotObjectGuard { SlotObjectGuard() = default; // move would be fine, but we do not need it currently Q_DISABLE_COPY_MOVE(SlotObjectGuard) - explicit SlotObjectGuard(QtPrivate::QSlotObjectBase *slotObject) + Q_NODISCARD_CTOR explicit SlotObjectGuard(QtPrivate::QSlotObjectBase *slotObject) : m_slotObject(slotObject) { if (m_slotObject)