diff --git a/src/corelib/tools/qsharedpointer_impl.h b/src/corelib/tools/qsharedpointer_impl.h index 7ac317eacb..7927a6dd2b 100644 --- a/src/corelib/tools/qsharedpointer_impl.h +++ b/src/corelib/tools/qsharedpointer_impl.h @@ -396,7 +396,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