From ef05c48898e90e4ff40d8c4493f4b80bc22c1703 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 13 Nov 2018 17:14:43 +0100 Subject: Fix -Wdeprecated-copy warnings Implicit copy constructors or methods are considered deprecated for classes that has one of the two or a destructor. The warning is enabled with -Wextra in gcc 9 Change-Id: Ic9be654f2a142fb186a4d5a7d6b4f7d6f4e611d8 Reviewed-by: Thiago Macieira --- src/corelib/tools/qlist.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/corelib/tools/qlist.h') diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h index 6643288bd5..e593ba9aa3 100644 --- a/src/corelib/tools/qlist.h +++ b/src/corelib/tools/qlist.h @@ -73,7 +73,7 @@ template class QSet; template struct QListSpecialMethods { protected: - ~QListSpecialMethods() {} + ~QListSpecialMethods() = default; }; template <> struct QListSpecialMethods; template <> struct QListSpecialMethods; @@ -249,6 +249,8 @@ public: // can't remove it in Qt 5, since doing so would make the type trivial, // which changes the way it's passed to functions by value. inline iterator(const iterator &o) Q_DECL_NOTHROW : i(o.i){} + inline iterator &operator=(const iterator &o) Q_DECL_NOTHROW + { i = o.i; return *this; } #endif inline T &operator*() const { return i->t(); } inline T *operator->() const { return &i->t(); } @@ -302,6 +304,8 @@ public: // can't remove it in Qt 5, since doing so would make the type trivial, // which changes the way it's passed to functions by value. inline const_iterator(const const_iterator &o) Q_DECL_NOTHROW : i(o.i) {} + inline const_iterator &operator=(const const_iterator &o) Q_DECL_NOTHROW + { i = o.i; return *this; } #endif #ifdef QT_STRICT_ITERATORS inline explicit const_iterator(const iterator &o) Q_DECL_NOTHROW : i(o.i) {} -- cgit v1.2.3