summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2017-04-19 16:03:33 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2017-04-20 12:14:57 +0000
commit0533f8ba47f57da5d7363c2c00cf0b239ce72888 (patch)
treeb12cb867e3b10c3dc5f900ea1fe5c82cd1756832
parent9882c2d27dd71e074d1c8a52a95e6f616014092e (diff)
downloadqtxmlpatterns-0533f8ba47f57da5d7363c2c00cf0b239ce72888.tar.gz
QXmlName: Add copy constructor and use default for copy/assignment
Fix Clang warning: 95:15: warning: definition of implicit copy constructor for 'QXmlName' is deprecated because it has a user-declared copy assignment operator qmetatype.h:1684:83: note: in instantiation of member function 'QtMetaTypePrivate::QMetaTypeFunctionHelper<QXmlName, true>::Construct' requested here qmetatype.h:1712:12: note: in instantiation of function template specialization 'qRegisterNormalizedMetaType<QXmlName>' requested here 134:1: note: in instantiation of function template specialization 'qRegisterMetaType<QXmlName>' requested here qmetatype.h:1848:34: note: expanded from macro 'Q_DECLARE_METATYPE' qmetatype.h:1860:35: note: expanded from macro 'Q_DECLARE_METATYPE_IMPL' qmetatype.h:765:32: note: implicit copy constructor for 'QXmlName' first required here Change-Id: I5e194201278d2a5d613eac9dc9cd7b36679697b3 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> (cherry picked from commit da19c9882295a8f3216284935c05ad4b89c445bd)
-rw-r--r--src/xmlpatterns/api/qxmlname.cpp2
-rw-r--r--src/xmlpatterns/api/qxmlname.h1
2 files changed, 2 insertions, 1 deletions
diff --git a/src/xmlpatterns/api/qxmlname.cpp b/src/xmlpatterns/api/qxmlname.cpp
index 090a122..a631de9 100644
--- a/src/xmlpatterns/api/qxmlname.cpp
+++ b/src/xmlpatterns/api/qxmlname.cpp
@@ -398,7 +398,7 @@ QString QXmlName::toClarkName(const QXmlNamePool &namePool) const
/*!
Assigns \a other to \e this and returns \e this.
*/
-QXmlName &QXmlName::operator=(const QXmlName &other)
+QXmlName &QXmlName::operator=(const QXmlName &other) // ### Qt 6: remove
{
m_qNameCode = other.m_qNameCode;
return *this;
diff --git a/src/xmlpatterns/api/qxmlname.h b/src/xmlpatterns/api/qxmlname.h
index b3d1bc0..c90b526 100644
--- a/src/xmlpatterns/api/qxmlname.h
+++ b/src/xmlpatterns/api/qxmlname.h
@@ -86,6 +86,7 @@ public:
QString toClarkName(const QXmlNamePool &query) const;
bool operator==(const QXmlName &other) const;
bool operator!=(const QXmlName &other) const;
+ Q_ALWAYS_INLINE QXmlName(const QXmlName &other) : m_qNameCode(other.m_qNameCode) {} // ### Qt 6: remove
QXmlName &operator=(const QXmlName &other);
bool isNull() const;
static bool isNCName(const QString &candidate);