diff options
author | Marc Mutz <[email protected]> | 2023-09-13 21:22:50 +0200 |
---|---|---|
committer | Ulf Hermann <[email protected]> | 2023-09-15 13:15:58 +0200 |
commit | ddc0fc42873526265690e61cfca0d0f45ed459fd (patch) | |
tree | fab9b0ec294abac1cae95ed8291554b6196aaab6 | |
parent | 9189ea15fa44fb072fc0a7737050074854d52527 (diff) |
QQmlSequence: fix compilation with GCC12/C++20
The V4_OBJECT2 macro passes its first argument to Q_DISABLE_COPY and
the extra template decorator then yields an invalid constructor name
that previous versions of C++ and/or GCC accepted, but newer ones
don't. We fixed a few of these in qtwebengine/src/3rdparty/chromium,
too.
Fixes: QTBUG-117018
Change-Id: I8ab1cab276b81894a7013667259ce0d2f33a4997
Reviewed-by: Edward Welbourne <[email protected]>
Reviewed-by: Ulf Hermann <[email protected]>
Reviewed-by: Marc Mutz <[email protected]>
-rw-r--r-- | src/qml/jsruntime/qv4sequenceobject.cpp | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4sequenceobject.cpp b/src/qml/jsruntime/qv4sequenceobject.cpp index 5105660ff0..e910352859 100644 --- a/src/qml/jsruntime/qv4sequenceobject.cpp +++ b/src/qml/jsruntime/qv4sequenceobject.cpp @@ -261,7 +261,33 @@ struct QQmlSequence : Object { template <typename Container> struct QQmlSequence : public QV4::Object { - V4_OBJECT2(QQmlSequence<Container>, QV4::Object) + // Unroll V4_OBJECT2(QQmlSequence<Container>, QV4::Object) here. + // Newer C++ versions don't tolerate the template argument in Q_DISABLE_COPY. +private: + QQmlSequence() Q_DECL_EQ_DELETE; + Q_DISABLE_COPY(QQmlSequence) +public: + Q_MANAGED_CHECK + typedef QV4::Heap::QQmlSequence<Container> Data; + typedef QV4::Object SuperClass; + static const QV4::VTable static_vtbl; + static inline const QV4::VTable *staticVTable() { return &static_vtbl; } + V4_MANAGED_SIZE_TEST + + QV4::Heap::QQmlSequence<Container> *d_unchecked() const + { + return static_cast<QV4::Heap::QQmlSequence<Container> *>(m()); + } + + QV4::Heap::QQmlSequence<Container> *d() const + { + QV4::Heap::QQmlSequence<Container> *dptr = d_unchecked(); + dptr->_checkIsInitialized(); + return dptr; + } + + Q_STATIC_ASSERT(std::is_trivial< QV4::Heap::QQmlSequence<Container>>::value); + Q_MANAGED_TYPE(QmlSequence) V4_PROTOTYPE(sequencePrototype) V4_NEEDS_DESTROY |