From b2a31f5be875f060cec4493f2dea3ac6d2ed2c14 Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 19 Feb 2020 09:17:08 +0100 Subject: [PATCH] Modeling: Fix deprecation warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In file included from /data/dev/qt-5/qtbase/include/QtCore/qlist.h:1, from /data/dev/qt-5/qtbase/include/QtCore/../../src/corelib/kernel/qobject.h:49, from /data/dev/qt-5/qtbase/include/QtCore/qobject.h:1, from /data/dev/qt-5/qtbase/include/QtCore/../../src/corelib/io/qiodevice.h:45, from /data/dev/qt-5/qtbase/include/QtCore/qiodevice.h:1, from /data/dev/qt-5/qtbase/include/QtCore/../../src/corelib/serialization/qdatastream.h:44, from /data/dev/qt-5/qtbase/include/QtCore/qdatastream.h:1, from /data/dev/qt-5/qtbase/include/QtCore/QDataStream:1, from ./qmt/infrastructure/uid.h:30, from qmt/model/melement.h:28, from qmt/model/mobject.h:28, from qmt/model/mobject.cpp:26: /data/dev/qt-5/qtbase/include/QtCore/../../src/corelib/tools/qlist.h: In instantiation of ‘void QList::node_construct(QList::Node*, const T&) [with T = qmt::Handle]’: /data/dev/qt-5/qtbase/include/QtCore/../../src/corelib/tools/qlist.h:622:13: required from ‘void QList::append(const T&) [with T = qmt::Handle]’ ./qmt/infrastructure/handles.h:162:9: required from ‘void qmt::Handles::add(const qmt::Uid&) [with T = qmt::MObject]’ qmt/model/mobject.cpp:80:23: required from here /data/dev/qt-5/qtbase/include/QtCore/../../src/corelib/tools/qlist.h:471:35: warning: implicitly-declared ‘constexpr qmt::Handle& qmt::Handle::operator=(const qmt::Handle&)’ is deprecated [-Wdeprecated-copy] 471 | else *reinterpret_cast(n) = t; | ~~~~~~~~~~~~~~~~~~~~~~~~~^~~ In file included from ./qmt/infrastructure/handles.h:28, from qmt/model/mobject.h:29, from qmt/model/mobject.cpp:26: ./qmt/infrastructure/handle.h:40:5: note: because ‘qmt::Handle’ has user-provided ‘qmt::Handle::Handle(const qmt::Handle&) [with T = qmt::MObject]’ 40 | Handle(const Handle &rhs) : m_uid(rhs.m_uid), m_target(rhs.m_target) { } | ^~~~~~ Change-Id: I9fe85f5b46912a52d1722da0f048d4eee6171ade Reviewed-by: Jochen Becher Reviewed-by: Eike Ziller --- src/libs/modelinglib/qmt/infrastructure/handle.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libs/modelinglib/qmt/infrastructure/handle.h b/src/libs/modelinglib/qmt/infrastructure/handle.h index 0c28c3f2287..b7333a11464 100644 --- a/src/libs/modelinglib/qmt/infrastructure/handle.h +++ b/src/libs/modelinglib/qmt/infrastructure/handle.h @@ -41,6 +41,8 @@ public: template Handle(const Handle &rhs) : m_uid(rhs.uid()), m_target(rhs.target()) { } + Handle &operator=(const Handle &) = default; + bool isNull() const { return !m_uid.isValid(); } bool hasTarget() const { return m_target != nullptr; } Uid uid() const { return m_uid; }