REPRODUCIBILITY: 100%
OS VERSION: 5.1.0.11
HARDWARE: SDK
UI LANGUAGE: matters not
REGRESSION: yes
DESCRIPTION:
You cannot compile program with c++20/23 if it includes QtQml. You could in sfos 5.0 so it its very much a regression. Mostlikely caused by jump in GCC version. It fails to compiile qfutureinterface.h. I would even welcome a program-side workaround to make it compile.
PRECONDITIONS:
CONFIG += c++20
QMAKE_CXXFLAGS_RELEASE += -std=c++20
QMAKE_CXXFLAGS_DEBUG += -std=c++20
And in .c file #include <QtQml>
STEPS TO REPRODUCE:
Try to compile app/program
EXPECTED RESULT:
It should compile successfully
ACTUAL RESULT:
It doesn’t.
MODIFICATIONS:
None it’s reproducible on fresh sdk install and freshly created project.
ADDITIONAL INFORMATION:
/home/foidbgen/Programs/SailfishOS/mersdk/targets/SailfishOS-5.1.0.11-aarch64.default/usr/include/qt5/QtCore/qfutureinterface.h:282:33: error: expected ‘)’ before ‘initialState’
282 | QFutureInterface<void>(State initialState = NoState)
| ~ ^~~~~~~~~~~~~
| )
/home/foidbgen/Programs/SailfishOS/mersdk/targets/SailfishOS-5.1.0.11-aarch64.default/usr/include/qt5/QtCore/qfutureinterface.h:285:28: error: expected unqualified-id before ‘const’
285 | QFutureInterface<void>(const QFutureInterface<void> &other)
| ^~~~~
/home/foidbgen/Programs/SailfishOS/mersdk/targets/SailfishOS-5.1.0.11-aarch64.default/usr/include/qt5/QtCore/qfutureinterface.h:285:28: error: expected ‘)’ before ‘const’
285 | QFutureInterface<void>(const QFutureInterface<void> &other)
| ~^~~~~
| )
/home/foidbgen/Programs/SailfishOS/mersdk/targets/SailfishOS-5.1.0.11-aarch64.default/usr/include/qt5/QtCore/qfutureinterface.h: In static member function ‘static QFutureInterface<void> QFutureInterface<void>::canceledResult()’:
/home/foidbgen/Programs/SailfishOS/mersdk/targets/SailfishOS-5.1.0.11-aarch64.default/usr/include/qt5/QtCore/qfutureinterface.h:290:67: error: no matching function for call to ‘QFutureInterface<void>::QFutureInterface(QFutureInterfaceBase::State)’
290 | { return QFutureInterface(State(Started | Finished | Canceled)); }
| ^
/home/foidbgen/Programs/SailfishOS/mersdk/targets/SailfishOS-5.1.0.11-aarch64.default/usr/include/qt5/QtCore/qfutureinterface.h:279:7: note: candidate: ‘QFutureInterface<void>::QFutureInterface()’
279 | class QFutureInterface<void> : public QFutureInterfaceBase
| ^~~~~~~~~~~~~~~~~~~~~~
/home/foidbgen/Programs/SailfishOS/mersdk/targets/SailfishOS-5.1.0.11-aarch64.default/usr/include/qt5/QtCore/qfutureinterface.h:279:7: note: candidate expects 0 arguments, 1 provided
/home/foidbgen/Programs/SailfishOS/mersdk/targets/SailfishOS-5.1.0.11-aarch64.default/usr/include/qt5/QtCore/qfutureinterface.h:279:7: note: candidate: ‘QFutureInterface<void>::QFutureInterface(const QFutureInterface<void>&)’
/home/foidbgen/Programs/SailfishOS/mersdk/targets/SailfishOS-5.1.0.11-aarch64.default/usr/include/qt5/QtCore/qfutureinterface.h:279:7: note: no known conversion for argument 1 from ‘QFutureInterfaceBase::State’ to ‘const QFutureInterface<void>&’
Also reported and discussed here.
What I do sometimes as a package-level workaround is (in the spec or something) copy the system header somewhere, patch it there, and then make sure the build picks that one up before the unpatched system version.
Haven’t tried in this particular case I think.
More like duplicate to me 
Down to the line numbers! 