summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qsharedpointer_impl.h
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2023-06-21 15:03:42 +0200
committerMarc Mutz <marc.mutz@qt.io>2023-06-21 22:46:40 +0200
commit51b97626857f13e785aae61c1beb16dc39601cd2 (patch)
treefa46744494f9d3f3b694e78c7466bcdda8c86eda /src/corelib/tools/qsharedpointer_impl.h
parent81d357ff8a7af8704ba5657caef04f28e7099625 (diff)
QSharedPointer: mark create() [[nodiscard]]
It's a named constructor of a smart pointer class. QUIP-0019 says constructors of such classes should be marked as [[noexcept]]. It doesn't (yet) say anything about _named_ constructors, but it makes sense to include them, too. Pick-to: 6.6 6.5 Task-number: QTBUG-104164 Change-Id: Ia4b43e4f819ce45d71274019c919fd98cc97878b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Diffstat (limited to 'src/corelib/tools/qsharedpointer_impl.h')
-rw-r--r--src/corelib/tools/qsharedpointer_impl.h2
1 files changed, 1 insertions, 1 deletions
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<T> toWeakRef() const;
template <typename... Args>
- static QSharedPointer create(Args && ...arguments)
+ [[nodiscard]] static QSharedPointer create(Args && ...arguments)
{
typedef QtSharedPointer::ExternalRefCountWithContiguousData<T> Private;
# ifdef QT_SHAREDPOINTER_TRACK_POINTERS