QMac{,RootLevel}AutoReleasePool: mark ctors [[nodiscard]]

They're RAII classes, and QUIP-0019 says RAII class' constructors
should be marked [[nodiscard]].

Task-number: QTBUG-104164
Change-Id: I0080f5b6a3cea346c0860e00958a8c204849040e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit ffed431293cb0fcb85bdda2e1c4db9bda79a00fc)
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
This commit is contained in:
Marc Mutz 2023-06-13 09:34:12 +02:00
parent ae41507317
commit ae04c6a16f

View File

@ -115,7 +115,7 @@ protected:
class QMacAutoReleasePool
{
public:
Q_CORE_EXPORT QMacAutoReleasePool();
Q_NODISCARD_CTOR Q_CORE_EXPORT QMacAutoReleasePool();
Q_CORE_EXPORT ~QMacAutoReleasePool();
private:
Q_DISABLE_COPY(QMacAutoReleasePool)
@ -126,7 +126,7 @@ private:
class QMacRootLevelAutoReleasePool
{
public:
QMacRootLevelAutoReleasePool();
Q_NODISCARD_CTOR QMacRootLevelAutoReleasePool();
~QMacRootLevelAutoReleasePool();
private:
QScopedPointer<QMacAutoReleasePool> pool;