From 724f7fb6c8c7512e58dd6bea9a5e1d3938447cca 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 Fixes: QTBUG-116496 Change-Id: Ifa1111900d6945ea8e05fffd177eab656a2dc507 Reviewed-by: Fabian Kosmale (cherry picked from commit bed203a6fccb77e008dc384615b0ffaae6e14b54) Reviewed-by: Qt Cherry-pick Bot --- 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 a2767396a89..74416ce011a 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,