diff options
author | Lars Knoll <lars.knoll@qt.io> | 2020-08-30 22:16:25 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2020-10-14 21:37:39 +0200 |
commit | fa93f1aeb0dd92acf0cbe2113425a1b21b8c82cb (patch) | |
tree | 1fc5cfa364da27f46911f84183d1161d278708fa /tests/auto/corelib/kernel/qmetaobject | |
parent | 0599255fcf54086ae345d289e8f761d890a91a39 (diff) |
Fix compile time type normalization code
Use a simpler constexpr to generate type name on gcc This
works around an ICE on gcc in release mode when compiling
with PCH enabled. As the type we're getting from Q_FUNC_INFO is
already in a somewhat normalized form, this requires significanlty
less processing and esp. not a recursive constexpr method which
I suspect triggers the ICE.
Fix integer type conversions to also properly normalize long long
values (to q(u)longlong. Make sure the mapping also works on
MSVC, where long long types get mapped to __int64. Also, normalize
unsigned short and unsigned char to ushort and uchar, respectively, to
follow the convention set by uint and ulong.
Add some test cases to verify the mappings.
Change-Id: I3dec5764450bf22ab6f066597803c3f46c2cd5ac
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'tests/auto/corelib/kernel/qmetaobject')
-rw-r--r-- | tests/auto/corelib/kernel/qmetaobject/tst_qmetaobject.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/auto/corelib/kernel/qmetaobject/tst_qmetaobject.cpp b/tests/auto/corelib/kernel/qmetaobject/tst_qmetaobject.cpp index c073e2d77f..08219d45d2 100644 --- a/tests/auto/corelib/kernel/qmetaobject/tst_qmetaobject.cpp +++ b/tests/auto/corelib/kernel/qmetaobject/tst_qmetaobject.cpp @@ -1402,15 +1402,15 @@ void tst_QMetaObject::normalizedType_data() QTest::newRow("QVector") << "QVector<int>" << "QList<int>"; QTest::newRow("refref") << "X const*const&&" << "const X*const&&"; QTest::newRow("refref2") << "const X<T const&&>&&" << "const X<const T&&>&&"; - QTest::newRow("long1") << "long unsigned int long" << "unsigned long long"; + QTest::newRow("long1") << "long unsigned int long" << "qulonglong"; QTest::newRow("long2") << "int signed long" << "long"; QTest::newRow("long3") << "long unsigned" << "ulong"; QTest::newRow("long double") << " long double" << "long double"; QTest::newRow("signed char") << "char signed" << "signed char"; - QTest::newRow("unsigned char") << "char unsigned" << "unsigned char"; + QTest::newRow("unsigned char") << "char unsigned" << "uchar"; QTest::newRow("signed short") << "short signed" << "short"; - QTest::newRow("unsigned shot") << "short unsigned" << "unsigned short"; - QTest::newRow("unsigned shot") << "short unsigned" << "unsigned short"; + QTest::newRow("unsigned short") << "unsigned short" << "ushort"; + QTest::newRow("short unsigned") << "short unsigned" << "ushort"; QTest::newRow("array1") << "unsigned int [4]" << "uint[4]"; QTest::newRow("array2") << "unsigned int const [4][5]" << "const uint[4][5]"; QTest::newRow("array3") << "unsigned[] const" << "uint[]"; |