From 9656e4fda612a810efde08c7e48f257f91c4d0dd Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 26 Jan 2023 14:43:05 +0100 Subject: [PATCH] QPermission: use move-and-swap, not pure-swap, for move-assignment While PURE_SWAP is the correct one today, this is inline code, so when we activate the d-pointer, we may have fields that hold non-memory resources, but it would be too late change existing binary users to MOVE_AND_SWAP, so do it already now. Change-Id: I18976cffe30eb4e37aa6d471cc6e75015e9b1ee7 Reviewed-by: Giuseppe D'Angelo (cherry picked from commit c2cdd7c371d7b9405728c1a30046ab3f257ee235) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/kernel/qpermissions.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/kernel/qpermissions.h b/src/corelib/kernel/qpermissions.h index b911c55e87e..f4d6b4b3703 100644 --- a/src/corelib/kernel/qpermissions.h +++ b/src/corelib/kernel/qpermissions.h @@ -89,7 +89,7 @@ public: \ : u{other.u} { other.u.d = nullptr; } \ Q_CORE_EXPORT ~ClassName(); \ Q_CORE_EXPORT ClassName &operator=(const ClassName &other) noexcept; \ - QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(ClassName) \ + QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_MOVE_AND_SWAP(ClassName) \ void swap(ClassName &other) noexcept { std::swap(u, other.u); } \ private: \ /*end*/