noexcept build errors after updating to 6.9.0
-
I am building a Qt console application in Linux and am getting build errors after updating Qt. I am building on RockyLinux 8.10. The program built fine with 6.6.3, but now I get the following errors after updating to 6.9.0
This error repeats over and over. The first and last lines of this snippet show the error.
../../../Qt/6.9.0/gcc_64/include/QtCore/qcomparehelpers.h:160:34: error: static assertion failed: Use *_NON_NOEXCEPT version of the macro, or make the helper function noexcept static_assert(!noexcept(f()) || noexcept(Func(lhs, rhs)), \ ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../../Qt/6.9.0/gcc_64/include/QtCore/qoverload.h:72:32: note: in definition of macro ‘QT_VA_ARGS_EXPAND’ #define QT_VA_ARGS_EXPAND(...) __VA_ARGS__ // Needed for MSVC ^~~~~~~~~~~ ../../../Qt/6.9.0/gcc_64/include/QtCore/qcomparehelpers.h:300:9: note: in expansion of macro ‘QT_COMPARISON_NOEXCEPT_CHECK’ QT_COMPARISON_NOEXCEPT_CHECK(Noexcept, comparesEqual); \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../../Qt/6.9.0/gcc_64/include/QtCore/qcomparehelpers.h:470:5: note: in expansion of macro ‘QT_DECLARE_EQUALITY_OPERATORS_HELPER’ QT_DECLARE_EQUALITY_OPERATORS_HELPER(LeftType, RightType, /* non-constexpr */, \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../../Qt/6.9.0/gcc_64/include/QtCore/qoverload.h:74:49: note: in expansion of macro ‘QT_DECLARE_EQUALITY_COMPARABLE_NON_NOEXCEPT_2’ #define QT_OVERLOADED_MACRO_EXPAND(MACRO, ARGC) MACRO##_##ARGC ^~~~~ ../../../Qt/6.9.0/gcc_64/include/QtCore/qoverload.h:75:46: note: in expansion of macro ‘QT_OVERLOADED_MACRO_EXPAND’ #define QT_OVERLOADED_MACRO_IMP(MACRO, ARGC) QT_OVERLOADED_MACRO_EXPAND(MACRO, ARGC) ^~~~~~~~~~~~~~~~~~~~~~~~~~ ../../../Qt/6.9.0/gcc_64/include/QtCore/qoverload.h:76:59: note: in expansion of macro ‘QT_OVERLOADED_MACRO_IMP’ #define QT_OVERLOADED_MACRO(MACRO, ...) QT_VA_ARGS_EXPAND(QT_OVERLOADED_MACRO_IMP(MACRO, QT_VA_ARGS_COUNT(__VA_ARGS__))(__VA_ARGS__)) ^~~~~~~~~~~~~~~~~~~~~~~ ../../../Qt/6.9.0/gcc_64/include/QtCore/qcomparehelpers.h:495:5: note: in expansion of macro ‘QT_OVERLOADED_MACRO’ QT_OVERLOADED_MACRO(QT_DECLARE_EQUALITY_COMPARABLE_NON_NOEXCEPT, __VA_ARGS__) ^~~~~~~~~~~~~~~~~~~ ../../../Qt/6.9.0/gcc_64/include/QtCore/qjsonobject.h:326:5: note: in expansion of macro ‘Q_DECLARE_EQUALITY_COMPARABLE_NON_NOEXCEPT’ Q_DECLARE_EQUALITY_COMPARABLE_NON_NOEXCEPT(QJsonObject, QJsonValue) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../../Qt/6.9.0/gcc_64/include/QtCore/qjsonobject.h: In function ‘bool operator==(const QJsonObject&, const QJsonValueConstRef&)’: ../../../Qt/6.9.0/gcc_64/include/QtCore/qcomparehelpers.h:160:34: error: static assertion failed: Use *_NON_NOEXCEPT version of the macro, or make the helper function noexcept static_assert(!noexcept(f()) || noexcept(Func(lhs, rhs)), \ ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
-
What gcc version do you use? When does the error occour? By simply including a Qt header in a simple main.cpp or what else?
-
@Christian-Ehrlicher I'm using gcc 8.5.0
I honestly can't tell where in the code the error is occuring because the output is so long. I've been building this applciation for years using various versions of Qt, but I haven't seen these errors before. It builds without error under Qt 6.6.3.I can try a simple program to see if I also get the errors there.