From ac7ff59b6ab2694c55b64cd0108b7df4529d9828 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Wed, 8 Jan 2025 14:57:04 +0100 Subject: [PATCH] function_ref_base: honor the RO5 I'm not entirely sure why function_ref_base declares its destructor. I guess it's declared in order to make it protected, because the class is non-polymorphic and inherited by function_ref, and one may want to avoid slicing. On the other hand, function_ref_base is an implementation detail, living in a `detail` namespace; so that sounds very unlikely. In any case, the class is clearly meant to be copiable, so add back (as protected) the missing special members. Pick-to: 6.8 6.5 Change-Id: Ibf909e1746e65eecf8b8990839a6e4c9eb56ca13 Reviewed-by: Marc Mutz (cherry picked from commit 74b875641f40b15a4a59a0c55cd79c251b49c05e) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/global/qxpfunctional.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/corelib/global/qxpfunctional.h b/src/corelib/global/qxpfunctional.h index cbeef8b2932..320ca5417c8 100644 --- a/src/corelib/global/qxpfunctional.h +++ b/src/corelib/global/qxpfunctional.h @@ -73,6 +73,10 @@ class function_ref_base { protected: ~function_ref_base() = default; + function_ref_base(const function_ref_base &) = default; + function_ref_base(function_ref_base &&) = default; + function_ref_base &operator=(const function_ref_base &) = default; + function_ref_base &operator=(function_ref_base &&) = default; using BoundEntityType = detail::BoundEntityType;