qmetatype: Fix incorrect more than one typedef warning

The names are the keys of a hash so they can come in any
order. That means the loop above, which stops before the end if
it finds a name that is not the official one, may not have seen
the official yet. If it has reached the end, then there is no
typedef alias.

Fixes: QTBUG-99620
Pick-to: 6.2 6.3
Change-Id: I3bd638766c494b32c665190d01db15c4cbc587b5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
This commit is contained in:
Jonas Kvinge 2022-01-15 17:06:38 +01:00 committed by Thiago Macieira
parent 74955f386d
commit 260294346b

View File

@ -207,7 +207,7 @@ const char *QtMetaTypePrivate::typedefNameForType(const QtPrivate::QMetaTypeInte
#ifndef QT_NO_DEBUG
QByteArrayList otherNames;
for ( ; it != end; ++it) {
if (it.value() == type_d)
if (it.value() == type_d && it.key() != officialName)
otherNames << it.key();
}
if (!otherNames.isEmpty())