Details
-
Bug
-
Resolution: Done
-
Not Evaluated
-
1.19.2
-
None
Description
I have heard that I have to use "c+20" value for cxxLanguageVersion to enable C+20 support for QBS projects in other reports:
https://bugreports.qt.io/browse/QBS-1656
https://bugreports.qt.io/browse/QTCREATORBUG-26089
However,
https://doc.qt.io/qbs/qml-qbsmodules-cpp.html#cxxLanguageVersion-prop
As you can see above, there is no official way to enable C++20 in QBS project.
As least for MSVC, any invalid value for cxxLanguageVersion appends "/std:c++latest" compiler flag as you can see here: https://github.com/qbs/qbs/blob/master/share/qbs/modules/cpp/msvc.js#L96
This enables C+20 features for MSVC 2017 and 2019 but it looks very hacky way because it is undocumented and setting invalid value to cxxLanguageVersion to enable C20 is very nonintuitive. Also, there exists a problem that Qt dependency removes the "/std:c+latest" flag(https://bugreports.qt.io/browse/QBS-1656).
QBS should provide official value to enable C+20(c20) or latest C+ features(c++latest).