Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
6.1.0, 6.2
-
None
Description
It's not possible to compile current Qt dev branch using gcc 11. So far noticed the following issues:
1. Warning at:
/home/jarek/dev/qt-dev/qtbase/src/corelib/global/qrandom.cpp: In member function ‘void QRandomGenerator::SystemAndGlobalGenerators::confirmLiteral()’:
/home/jarek/dev/qt-dev/qtbase/src/corelib/global/qrandom.cpp:380:28: warning: ‘template<class _Tp> struct std::is_literal_type’ is deprecated [-Wdeprecated-declarations]
380 | static_assert(std::is_literal_type<SystemAndGlobalGenerators>::value);
| ^~~~~~~~~~~~~~~
In file included from qtbase/include/QtCore/../../../../qt-dev/qtbase/src/corelib/global/qglobal.h:45,
from qtbase/include/QtCore/qglobal.h:1,
from qtbase/include/QtCore/../../../../qt-dev/qtbase/src/corelib/tools/qalgorithms.h:43,
from qtbase/include/QtCore/qalgorithms.h:1,
from /home/jarek/dev/qt-dev/qtbase/src/corelib/global/qrandom.h:43,
from /home/jarek/dev/qt-dev/qtbase/src/corelib/global/qrandom.cpp:44:
/usr/include/c++/11/type_traits:711:5: note: declared here
711 | is_literal_type
| ^~~~~~~~~~~~~~~
The std::is_literal_type is deprecated in C++ 17 and removed in C++ 20. Don't know what's the appropriate substitution. Please see a new comment added here: https://codereview.qt-project.org/c/qt/qtbase/+/208822.
Fixed in: https://codereview.qt-project.org/c/qt/qtbase/+/346929
2. Error:
/home/jarek/dev/qt-dev/qtbase/src/corelib/itemmodels/qitemselectionmodel_p.h: In static member function ‘static constexpr size_t QItemSelectionModelPrivate::_qt_property_model_offset()’: /home/jarek/dev/qt-dev/qtbase/src/corelib/itemmodels/qitemselectionmodel_p.h:98:40: error: ‘offsetof’ within non-standard-layout type ‘QItemSelectionModelPrivate’ is conditionally-supported [-Werror=invalid-offsetof] 98 | Q_OBJECT_COMPAT_PROPERTY_WITH_ARGS(QItemSelectionModelPrivate, QAbstractItemModel *, model, /home/jarek/dev/qt-dev/qtbase/src/corelib/global/qglobal.h:1394:49: note: in expansion of macro ‘Q_OBJECT_COMPAT_PROPERTY_WITH_ARGS6’ 1394 | #define QT_OVERLOADED_MACRO_EXPAND(MACRO, ARGC) MACRO##ARGC | ^~~~~ /home/jarek/dev/qt-dev/qtbase/src/corelib/itemmodels/qitemselectionmodel_p.h:98:5: note: in expansion of macro ‘Q_OBJECT_COMPAT_PROPERTY_WITH_ARGS’ 98 | Q_OBJECT_COMPAT_PROPERTY_WITH_ARGS(QItemSelectionModelPrivate, QAbstractItemModel *, model, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
or
/home/jarek/dev/qt-dev/qtbase/src/corelib/kernel/qtimer.cpp: In static member function ‘static constexpr size_t QTimerPrivate::_qt_property_inter_offset()’: /home/jarek/dev/qt-dev/qtbase/src/corelib/kernel/qtimer.cpp:61:40: error: ‘offsetof’ within non-standard-layout type ‘QTimerPrivate’ is conditionally-supported [-Werror=invalid-offsetof] 61 | Q_OBJECT_COMPAT_PROPERTY_WITH_ARGS(QTimerPrivate, int, inter, &QTimerPrivate::setInterval, 0) /home/jarek/dev/qt-dev/qtbase/src/corelib/global/qglobal.h:1394:49: note: in expansion of macro ‘Q_OBJECT_COMPAT_PROPERTY_WITH_ARGS5’ 1394 | #define QT_OVERLOADED_MACRO_EXPAND(MACRO, ARGC) MACRO##ARGC | ^~~~~ /home/jarek/dev/qt-dev/qtbase/src/corelib/kernel/qtimer.cpp:61:5: note: in expansion of macro ‘Q_OBJECT_COMPAT_PROPERTY_WITH_ARGS’ 61 | Q_OBJECT_COMPAT_PROPERTY_WITH_ARGS(QTimerPrivate, int, inter, &QTimerPrivate::setInterval, 0) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/jarek/dev/qt-dev/qtbase/src/corelib/kernel/qtimer.cpp: In static member function ‘static constexpr size_t QTimerPrivate::_qt_property_single_offset()’: /home/jarek/dev/qt-dev/qtbase/src/corelib/kernel/qtimer.cpp:62:42: error: ‘offsetof’ within non-standard-layout type ‘QTimerPrivate’ is conditionally-supported [-Werror=invalid-offsetof] 62 | Q_OBJECT_BINDABLE_PROPERTY_WITH_ARGS(QTimerPrivate, bool, single, false) | ^ /home/jarek/dev/qt-dev/qtbase/src/corelib/kernel/qtimer.cpp: In static member function ‘static constexpr size_t QTimerPrivate::_qt_property_type_offset()’: /home/jarek/dev/qt-dev/qtbase/src/corelib/kernel/qtimer.cpp:64:42: error: ‘offsetof’ within non-standard-layout type ‘QTimerPrivate’ is conditionally-supported [-Werror=invalid-offsetof] 64 | Q_OBJECT_BINDABLE_PROPERTY_WITH_ARGS(QTimerPrivate, Qt::TimerType, type, Qt::CoarseTimer) | ^
Please see https://codereview.qt-project.org/c/qt/qtbase/+/327044 for more info.
Fixed in: https://codereview.qt-project.org/c/qt/qtbase/+/346636
3. Probably unrelated to the error above:
/home/jarek/dev/qt-dev/qtbase/src/corelib/tools/qsharedpointer.cpp: In static member function ‘static QtSharedPointer::ExternalRefCountData* QtSharedPointer::ExternalRefCountData::getAndRef(const QObject*)’: /home/jarek/dev/qt-dev/qtbase/src/corelib/tools/qsharedpointer.cpp:1414:16: error: ‘static void QtSharedPointer::ExternalRefCountData::operator delete(void*)’ called on pointer returned from a mismatched allocation function [-Werror=mismatched-new-delete] 1414 | delete x; | ^ /home/jarek/dev/qt-dev/qtbase/src/corelib/tools/qsharedpointer.cpp:1403:73: note: returned from ‘void* operator new(std::size_t)’ 1403 | ExternalRefCountData *x = new ExternalRefCountData(Qt::Uninitialized); | ^
Fixed in: https://codereview.qt-project.org/c/qt/qtbase/+/350822
4. After fixes to the points 1-3 were merged, there is also one more issue. Getting many errors like that:
qtbase/include/QtCore/../../../../qt-dev/qtbase/src/corelib/kernel/qtmetamacros.h:159:32: error: ‘virtual const QMetaObject* QAbstractEventDispatcher::metaObject() const’ can be marked override [-Werror=suggest-override] 159 | virtual const QMetaObject *metaObject() const; \ | ^~~~~~~~~~ qtbase/include/QtCore/../../../../qt-dev/qtbase/src/corelib/kernel/qabstracteventdispatcher.h:54:5: note: in expansion of macro ‘Q_OBJECT’ 54 | Q_OBJECT | ^~~~~~~~ qtbase/include/QtCore/../../../../qt-dev/qtbase/src/corelib/kernel/qtmetamacros.h:160:19: error: ‘virtual void* QAbstractEventDispatcher::qt_metacast(const char*)’ can be marked override [-Werror=suggest-override] 160 | virtual void *qt_metacast(const char *); \ | ^~~~~~~~~~~ qtbase/include/QtCore/../../../../qt-dev/qtbase/src/corelib/kernel/qabstracteventdispatcher.h:54:5: note: in expansion of macro ‘Q_OBJECT’ 54 | Q_OBJECT | ^~~~~~~~
or:
qtbase/include/QtCore/../../../../qt-dev/qtbase/src/corelib/kernel/qtmetamacros.h:159:32: error: ‘virtual const QMetaObject* QSocketNotifier::metaObject() const’ can be marked override [-Werror=suggest-override] 159 | virtual const QMetaObject *metaObject() const; \ | ^~~~~~~~~~ qtbase/include/QtCore/../../../../qt-dev/qtbase/src/corelib/kernel/qsocketnotifier.h:51:5: note: in expansion of macro ‘Q_OBJECT’ 51 | Q_OBJECT | ^~~~~~~~ qtbase/include/QtCore/../../../../qt-dev/qtbase/src/corelib/kernel/qtmetamacros.h:160:19: error: ‘virtual void* QSocketNotifier::qt_metacast(const char*)’ can be marked override [-Werror=suggest-override] 160 | virtual void *qt_metacast(const char *); \ | ^~~~~~~~~~~ qtbase/include/QtCore/../../../../qt-dev/qtbase/src/corelib/kernel/qsocketnotifier.h:51:5: note: in expansion of macro ‘Q_OBJECT’ 51 | Q_OBJECT | ^~~~~~~~
Fixed in: https://codereview.qt-project.org/c/qt/qtbase/+/351382
Attachments
Issue Links
- relates to
-
QTBUG-94059 Stop using mixed enum arithmetic
- Closed
-
QTBUG-89977 Qt build on GCC 11
- Closed
For Gerrit Dashboard: QTBUG-93360 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
346636,11 | gcc 11: Adjust pragma warning placement | dev | qt/qtbase | Status: MERGED | +2 | 0 |
346992,1 | Fix build with GCC 11: drop std::is_literal_type | dev | qt/qtbase | Status: ABANDONED | 0 | 0 |
350822,7 | QSharedPointer: Use matching new/delete | dev | qt/qtbase | Status: MERGED | +2 | 0 |
350823,7 | Q_OBJECT: use override | dev | qt/qtbase | Status: ABANDONED | -1 | 0 |
350900,1 | gcc 11: Adjust pragma warning placement | 6.1 | qt/qtbase | Status: ABANDONED | 0 | 0 |
350901,2 | QSharedPointer: Use matching new/delete | 6.1 | qt/qtbase | Status: MERGED | +2 | 0 |
351382,3 | Add GCC 11 and C++20 workarounds | dev | qt/qtbase | Status: MERGED | +2 | 0 |
355528,2 | Add GCC 11 and C++20 workarounds | 6.2 | qt/qtbase | Status: MERGED | +2 | 0 |
355529,2 | Add GCC 11 and C++20 workarounds | 6.1 | qt/qtbase | Status: MERGED | +2 | 0 |
355569,3 | Update the minimum GCC version for -Wsuggest-override | dev | qt/qtbase | Status: ABANDONED | 0 | 0 |
408365,2 | QSharedPointer: Use matching new/delete | tqtc/lts-5.15 | qt/tqtc-qtbase | Status: MERGED | +2 | 0 |