diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2022-12-07 11:16:05 -0800 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2022-12-09 05:07:25 +0000 |
commit | abaa3e61120529b656922c2272b99a674d9e1a38 (patch) | |
tree | b1aec19984047f8d3a36a5bc8265dff50fbd7014 /tests/auto | |
parent | f222053c0b4592ba0b182e6690be5d400448967c (diff) |
tst_qdbusmetatype: fix build with Clang (and probably MSVC)
This test makes use of a GCC extension-slash-defect in matching of
template template parameters. Either Clang has recently changed its
behavior not to accept them any more, or we've never compiled this test
with Clang.
Tested with Clang 15.0.6.
Pick-to: 6.4
Change-Id: I69ecc04064514f939896fffd172e98d826989ca3
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/dbus/qdbusmetatype/tst_qdbusmetatype.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/auto/dbus/qdbusmetatype/tst_qdbusmetatype.cpp b/tests/auto/dbus/qdbusmetatype/tst_qdbusmetatype.cpp index 8749d88536..295ebc1828 100644 --- a/tests/auto/dbus/qdbusmetatype/tst_qdbusmetatype.cpp +++ b/tests/auto/dbus/qdbusmetatype/tst_qdbusmetatype.cpp @@ -245,7 +245,14 @@ void tst_QDBusMetaType::initTestCase() qDBusRegisterMetaType<QList<Struct3> >(); qDBusRegisterMetaType<QList<Struct4> >(); +#ifdef Q_CC_GNU_ONLY + // GCC has a defect/extension (depending on your point of view) that allows + // a template class with defaulted template parameters to match a Template + // Template Parameter (TTP) with fewer template arguments. The call below + // tries to use the template<template <typename> class Container, ...> + // template functions qdbusargument.h qDBusRegisterMetaType<std::vector<Struct1> >(); +#endif qDBusRegisterMetaType<Invalid0>(); qDBusRegisterMetaType<Invalid1>(); @@ -307,7 +314,9 @@ void tst_QDBusMetaType::dynamicTypes_data() QTest::newRow("Struct1") << qMetaTypeId<Struct1>() << "(s)"; QTest::newRow("QList<Struct1>") << qMetaTypeId<QList<Struct1> >() << "a(s)"; +#ifdef Q_CC_GNU_ONLY QTest::newRow("std::vector<Struct1>") << qMetaTypeId<std::vector<Struct1> >() << "a(s)"; +#endif QTest::newRow("Struct2") << qMetaTypeId<Struct2>() << "(sos)"; QTest::newRow("QList<Struct2>") << qMetaTypeId<QList<Struct2>>() << "a(sos)"; |