diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2023-08-25 08:56:01 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2023-08-29 07:38:36 -0700 |
commit | bed203a6fccb77e008dc384615b0ffaae6e14b54 (patch) | |
tree | ca1e4055793e671c5b8532dbe6163b6b095d841b | |
parent | 7e84a04563142d217317928865a8f6475d189d95 (diff) |
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 <fabian.kosmale@qt.io>
-rw-r--r-- | src/corelib/kernel/qvariant.cpp | 16 |
1 files changed, 0 insertions, 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 <typename F> 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<QVariant::PrivateShared, Deleter> 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 <CustomConstructMoveOptions moveOption = UseCopy, CustomConstructNullabilityOption nullability = MaybeNull> static void customConstruct(const QtPrivate::QMetaTypeInterface *iface, QVariant::Private *d, |