QMetaType: suppress non-conversion content in convert()

Many of the conversions are implemented by macros and may include
conversion from a type to itself. We never call the convert() function
with those parameters, so that code can be safely suppressed.

Pick-to: 6.9
Change-Id: I31904243ae8f750a3002fffd85f944305f0eee6b
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
Thiago Macieira 2025-03-17 11:17:24 -07:00
parent 1c26a93b3d
commit 3e1d147986

View File

@ -22,6 +22,8 @@ QT_BEGIN_NAMESPACE
#define QMETATYPE_CONVERTER(To, From, assign_and_return) \
case makePair(QMetaType::To, QMetaType::From): \
if constexpr (QMetaType::To == QMetaType::From) \
Q_UNREACHABLE(); /* can never get here */ \
if (onlyCheck) \
return true; \
{ \