diff --git a/src/corelib/tools/qsharedpointer_impl.h b/src/corelib/tools/qsharedpointer_impl.h index ac9bd2d77eb..9777b1a0a0d 100644 --- a/src/corelib/tools/qsharedpointer_impl.h +++ b/src/corelib/tools/qsharedpointer_impl.h @@ -386,7 +386,7 @@ public: [[nodiscard]] QWeakPointer toWeakRef() const; template - static QSharedPointer create(Args && ...arguments) + [[nodiscard]] static QSharedPointer create(Args && ...arguments) { typedef QtSharedPointer::ExternalRefCountWithContiguousData Private; # ifdef QT_SHAREDPOINTER_TRACK_POINTERS