From 28dd8ee71bdb4b69d86ea85ef18afc47cc7f2853 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Wed, 13 Oct 2010 22:13:29 +0200 Subject: Add a few default-constructors to comply with C++'03 [dcl.init] p9 C++'03 [dcl.init] p9 says: "If no initializer is specified for an object, and the object is of (possibly cv-qualified) non-POD class type (or array thereof), the object shall be default-initialized; if the object is of const-qualified type, the underlying class type shall have a user-declared default constructor." QXmlStreamAttributes and a few classes in the QXmlQuery test were missing them. Relevant GCC and Clang bugs: - http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42844 - http://llvm.org/bugs/show_bug.cgi?id=6772 Reviewed-by: Olivier Goffart --- src/corelib/xml/qxmlstream.h | 1 + tests/auto/qxmlquery/tst_qxmlquery.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/corelib/xml/qxmlstream.h b/src/corelib/xml/qxmlstream.h index 402afa3..d7143bd 100644 --- a/src/corelib/xml/qxmlstream.h +++ b/src/corelib/xml/qxmlstream.h @@ -169,6 +169,7 @@ Q_DECLARE_TYPEINFO(QXmlStreamAttribute, Q_MOVABLE_TYPE); class Q_XMLSTREAM_EXPORT QXmlStreamAttributes : public QVector { public: + inline QXmlStreamAttributes() {} QStringRef value(const QString &namespaceUri, const QString &name) const; QStringRef value(const QString &namespaceUri, const QLatin1String &name) const; QStringRef value(const QLatin1String &namespaceUri, const QLatin1String &name) const; diff --git a/tests/auto/qxmlquery/tst_qxmlquery.cpp b/tests/auto/qxmlquery/tst_qxmlquery.cpp index 2187aeb..b7c8740 100644 --- a/tests/auto/qxmlquery/tst_qxmlquery.cpp +++ b/tests/auto/qxmlquery/tst_qxmlquery.cpp @@ -455,6 +455,7 @@ void tst_QXmlQuery::assignmentOperator() const class ReturnURI : public QAbstractUriResolver { public: + ReturnURI() {} virtual QUrl resolve(const QUrl &relative, const QUrl &baseURI) const { @@ -2858,6 +2859,7 @@ void tst_QXmlQuery::useUriResolver() const , private TestFundament { public: + TestUriResolver() {} virtual QUrl resolve(const QUrl &relative, const QUrl &baseURI) const { -- cgit v0.12