summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2020-10-15 08:54:48 +0200
committerUlf Hermann <ulf.hermann@qt.io>2020-10-16 13:53:02 +0200
commit7745b49b2d7699334d0967d41535b1e162046860 (patch)
tree219b3cff6c32ffa34bc6916d64a041b9b8a54ebe /src/corelib/kernel
parentb3f3ebc2c0c9ba4142d553d02c86497377f4b3ef (diff)
QMetaType: Silence float comparison warnings in QEqualityOperatorForType
We actually do want to invoke the original equality operator there. If that is unsafe, we cannot do much about it at this point. Change-Id: Iadb2eaba1156828d89022d282c41bda57b500b13 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r--src/corelib/kernel/qmetatype.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h
index 18d911d33b..3b84327e91 100644
--- a/src/corelib/kernel/qmetatype.h
+++ b/src/corelib/kernel/qmetatype.h
@@ -2121,8 +2121,11 @@ struct BuiltinMetaType<T, std::enable_if_t<QMetaTypeId2<T>::IsBuiltIn>>
template<typename T, bool = (QTypeTraits::has_operator_equal_v<T> && !std::is_pointer_v<T>)>
struct QEqualityOperatorForType
{
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_FLOAT_COMPARE
static bool equals(const QMetaTypeInterface *, const void *a, const void *b)
{ return *reinterpret_cast<const T *>(a) == *reinterpret_cast<const T *>(b); }
+QT_WARNING_POP
};
template<typename T>