From 1f80d1a5eb954856c29be75e77aad267b59ab3d0 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Sat, 6 Jun 2020 00:26:27 +0200 Subject: [PATCH] QVariant: use std::addressof instead of operator& Change-Id: If7172e9e0e213d99f0c54b387dde8f9e163109d0 Reviewed-by: Marc Mutz --- src/corelib/kernel/qvariant.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/corelib/kernel/qvariant.h b/src/corelib/kernel/qvariant.h index 2cc09ba616..1f79bdfd89 100644 --- a/src/corelib/kernel/qvariant.h +++ b/src/corelib/kernel/qvariant.h @@ -53,6 +53,8 @@ #include #endif +#include + #if __has_include() && __cplusplus >= 201703L #include #elif defined(Q_CLANG_QDOC) @@ -362,7 +364,7 @@ class Q_CORE_EXPORT QVariant template static inline QVariant fromValue(const T &value) { - return QVariant(QMetaType::fromType(), &value); + return QVariant(QMetaType::fromType(), std::addressof(value)); } #if (__has_include() && __cplusplus >= 201703L) || defined(Q_CLANG_QDOC)