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 07:19:30 +0000
commitda19c9882295a8f3216284935c05ad4b89c445bd (patch)
treeb0590022a703d280a06a79ab660b7a8017b5aef5
parent3a44e86cdceba7acc6b830274968b0dfa482f5a8 (diff)
downloadqtxmlpatterns-da19c9882295a8f3216284935c05ad4b89c445bd.tar.gz
QXmlName: Add copy constructor and use default for copy/assignmentv5.9.0-beta3
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>
-rw-r--r--src/xmlpatterns/api/qxmlname.cpp14
-rw-r--r--src/xmlpatterns/api/qxmlname.h1
2 files changed, 10 insertions, 5 deletions
diff --git a/src/xmlpatterns/api/qxmlname.cpp b/src/xmlpatterns/api/qxmlname.cpp
index 241aa5e..83b72cf 100644
--- a/src/xmlpatterns/api/qxmlname.cpp
+++ b/src/xmlpatterns/api/qxmlname.cpp
@@ -402,13 +402,17 @@ QString QXmlName::toClarkName(const QXmlNamePool &namePool) const
}
/*!
+ Constructs a copy of \a other.
+
+ \sa operator=()
+ \since 5.9
+*/
+QXmlName::QXmlName(const QXmlName &) = default; // ### Qt 6: remove
+
+/*!
Assigns \a other to \e this and returns \e this.
*/
-QXmlName &QXmlName::operator=(const QXmlName &other)
-{
- m_qNameCode = other.m_qNameCode;
- return *this;
-}
+QXmlName &QXmlName::operator=(const QXmlName &) = default; // ### Qt 6: remove
/*!
Returns true if \a candidate is an \c NCName. An \c NCName
diff --git a/src/xmlpatterns/api/qxmlname.h b/src/xmlpatterns/api/qxmlname.h
index 7dad306..0e30b4c 100644
--- a/src/xmlpatterns/api/qxmlname.h
+++ b/src/xmlpatterns/api/qxmlname.h
@@ -92,6 +92,7 @@ public:
QString toClarkName(const QXmlNamePool &query) const;
bool operator==(const QXmlName &other) const;
bool operator!=(const QXmlName &other) const;
+ QXmlName(const QXmlName &other);
QXmlName &operator=(const QXmlName &other);
bool isNull() const;
static bool isNCName(const QString &candidate);