summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/tools
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2021-04-11 11:08:13 +0200
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2021-04-11 19:53:51 +0200
commited8429495e32537e5f426f5feb5a3b7eb0dca102 (patch)
treef9d6fded92ee05a8189887faf71c58ca8c954cbb /tests/auto/corelib/tools
parentfa3b672f998486bb7771c8e32ed43c45f55c4e63 (diff)
Fix gcc warnings from having only one of assignment/copy
For example: warning: implicitly-declared ‘constexpr Complex& Complex::operator=(const Complex&)’ is deprecated [-Wdeprecated-copy] Pick-to: 6.1 Change-Id: I7598e821acb7cb7bf17776d693af62778185afc5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/corelib/tools')
-rw-r--r--tests/auto/corelib/tools/containerapisymmetry/tst_containerapisymmetry.cpp2
-rw-r--r--tests/auto/corelib/tools/qcache/tst_qcache.cpp1
-rw-r--r--tests/auto/corelib/tools/qhash/tst_qhash.cpp2
3 files changed, 5 insertions, 0 deletions
diff --git a/tests/auto/corelib/tools/containerapisymmetry/tst_containerapisymmetry.cpp b/tests/auto/corelib/tools/containerapisymmetry/tst_containerapisymmetry.cpp
index 7eb4125553..3224a8c877 100644
--- a/tests/auto/corelib/tools/containerapisymmetry/tst_containerapisymmetry.cpp
+++ b/tests/auto/corelib/tools/containerapisymmetry/tst_containerapisymmetry.cpp
@@ -106,6 +106,8 @@ struct Complex
{
--instanceCount;
}
+ constexpr Complex &operator=(const Complex &o) noexcept
+ { i = o.i; return *this; }
int i;
static int instanceCount;
diff --git a/tests/auto/corelib/tools/qcache/tst_qcache.cpp b/tests/auto/corelib/tools/qcache/tst_qcache.cpp
index f8b0aba2dc..eb024e8f9e 100644
--- a/tests/auto/corelib/tools/qcache/tst_qcache.cpp
+++ b/tests/auto/corelib/tools/qcache/tst_qcache.cpp
@@ -359,6 +359,7 @@ struct KeyType
int foo;
KeyType(int x) : foo(x) {}
+ constexpr KeyType(const KeyType &o) noexcept : foo(o.foo) {}
private:
KeyType &operator=(const KeyType &);
diff --git a/tests/auto/corelib/tools/qhash/tst_qhash.cpp b/tests/auto/corelib/tools/qhash/tst_qhash.cpp
index 079b9c6ab7..d77160ba19 100644
--- a/tests/auto/corelib/tools/qhash/tst_qhash.cpp
+++ b/tests/auto/corelib/tools/qhash/tst_qhash.cpp
@@ -97,6 +97,8 @@ struct Foo {
Foo():c(count) { ++count; }
Foo(const Foo& o):c(o.c) { ++count; }
~Foo() { --count; }
+ constexpr Foo &operator=(const Foo &o) noexcept { c = o.c; return *this; }
+
int c;
int data[8];
};