Uploaded image for project: 'Qbs ("Cubes")'
  1. Qbs ("Cubes")
  2. QBS-1657

No cpp.cxxLanguageVersion value for C++20

    XMLWordPrintable

Details

    • All

    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).

      Attachments

        For Gerrit Dashboard: QBS-1657
        # Subject Branch Project Status CR V

        Activity

          People

            kandeler Christian Kandeler
            xylosper Byoung-young Lee
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes