From 25b1405dbfb291e23a7aacae8be57f36d0f144af Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Fri, 2 Aug 2024 14:27:19 +0200 Subject: [PATCH] QVariant::setValue(T&&): remove a facually incorrect comment The function template is constrained in the template-initializer to only rvalues, therefore this overload is never instantiated for lvalue. Amends 79ae79d05c65019233cf9ae9e77ef59d90e75ac2. Pick-to: 6.7 Change-Id: If0260799fa233eba1ccb3545b9d053496901fc2e Reviewed-by: Fabian Kosmale (cherry picked from commit 297bc0fb306954dbdf34d80017055b6924315d81) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/kernel/qvariant.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/corelib/kernel/qvariant.h b/src/corelib/kernel/qvariant.h index 5c388aebbd2..fd427db1b29 100644 --- a/src/corelib/kernel/qvariant.h +++ b/src/corelib/kernel/qvariant.h @@ -552,9 +552,8 @@ public: return QVariant(); QMetaType mt = QMetaType::fromType(); mt.registerType(); // we want the type stored in QVariant to always be registered - // T is a forwarding reference, so if T satifies the enable-ifery, - // we get this overload even if T is an lvalue reference and thus must check here - // Moreover, we only try to move if the type is actually moveable and not if T is const + + // We only try to move if the type is actually moveable and not if T is const // as in const int i; QVariant::fromValue(std::move(i)); if constexpr (std::conjunction_v, std::negation>>) return moveConstruct(QMetaType::fromType(), std::addressof(value));