There are warnings within the qt6 header files if c++20 is not used, for example:
usr/include/x86_64-linux-gnu/qt6/QtCore/qfuturesynchronizer.h:21:5: warning: use of the 'nodiscard' attribute is a C++20 extension [-Wc++20-attribute-extensions]
21 | Q_NODISCARD_CTOR_X("Use future.waitForFinished() instead.")
| ^
/usr/include/x86_64-linux-gnu/qt6/QtCore/qcompilerdetection.h:972:43: note: expanded from macro 'Q_NODISCARD_CTOR_X'
972 | # define Q_NODISCARD_CTOR_X(message) [[nodiscard(message)]]
| ^
1 warning generated.
qmake6 --version
QMake version 3.1
Using Qt version 6.8.3 in /usr/lib/x86_64-linux-gnu