From bed203a6fccb77e008dc384615b0ffaae6e14b54 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 25 Aug 2023 08:56:01 -0700 Subject: [PATCH] QVariant: de-duplicate customConstructShared() Commit 3ad9f94ff2de3a1f812bb0139ff31e31d5ffb529 (Feb 2023) moved it to qvariant_p.h but commit 79ae79d05c65019233cf9ae9e77ef59d90e75ac2 (authored Sep 2022 but committed June 2023) brought it back, probably by accident due to conflict resolution during rebasing. For some reason, no compiler in our CI complains about it, but ICX 2023 (based on unrelased Clang versions) did: variant_p.h(101,23): error: call to 'customConstructShared' is ambiguous Pick-to: 6.6 Fixes: QTBUG-116496 Change-Id: Ifa1111900d6945ea8e05fffd177eab656a2dc507 Reviewed-by: Fabian Kosmale --- src/corelib/kernel/qvariant.cpp | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp index 2935002809..9f948d5b1f 100644 --- a/src/corelib/kernel/qvariant.cpp +++ b/src/corelib/kernel/qvariant.cpp @@ -245,22 +245,6 @@ enum CustomConstructNullabilityOption { // future option: AlwaysNull? }; - -template static QVariant::PrivateShared * -customConstructShared(size_t size, size_t align, F &&construct) -{ - struct Deleter { - void operator()(QVariant::PrivateShared *p) const - { QVariant::PrivateShared::free(p); } - }; - - // this is exception-safe - std::unique_ptr ptr; - ptr.reset(QVariant::PrivateShared::create(size, align)); - construct(ptr->data()); - return ptr.release(); -} - // the type of d has already been set, but other field are not set template static void customConstruct(const QtPrivate::QMetaTypeInterface *iface, QVariant::Private *d,