From 239474710d7e1ef1ef7c3ccfeee88cd419903514 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Wed, 8 Jan 2025 14:47:37 +0100 Subject: [PATCH] QCborContainerPrivate: honor the RO5 The class defines a destructor, but it's also meant to be copy/move constructible (being a shared data for QCbor* classes). On the same note, the class is not meant to be assignable, as doing so would corrupt the refcounting, so delete those operations. Change-Id: I7781773da86b26544f9389337bfc059d9483fef9 Reviewed-by: Thiago Macieira --- src/corelib/serialization/qcborvalue_p.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/corelib/serialization/qcborvalue_p.h b/src/corelib/serialization/qcborvalue_p.h index f6eafce6084..7e969d0c195 100644 --- a/src/corelib/serialization/qcborvalue_p.h +++ b/src/corelib/serialization/qcborvalue_p.h @@ -101,6 +101,12 @@ class QCborContainerPrivate : public QSharedData ~QCborContainerPrivate(); public: + QCborContainerPrivate() = default; + QCborContainerPrivate(const QCborContainerPrivate &) = default; + QCborContainerPrivate(QCborContainerPrivate &&) = default; + QCborContainerPrivate &operator=(const QCborContainerPrivate &) = delete; + QCborContainerPrivate &operator=(QCborContainerPrivate &&) = delete; + enum ContainerDisposition { CopyContainer, MoveContainer }; QByteArray::size_type usedData = 0;