Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-21793

A GenericProject can no longer be set to CXX17 [4.8 regression]

    XMLWordPrintable

Details

    • Linux/X11

    Description

      A simple generic project can no longer be set to CXX17 in 4.8. Possible because commit [1] which says "[if a -std=X] was not provided, we assumed the latest version we support." - now it no longer assumes that and is stuck to CXX14.

      It might also have something to do with [2], which means setting the __cplusplus define no longer works, see comment [3]. Now there is no way to notify a generic project of the C++ version?

      Minimal example, using the default kit with the system GCC 8.1.

      touch gp.creator gp.includes # empty
      echo '#define __cplusplus 201703L' > gp.config
      echo 'main.cpp' > gp.files
      cat > main.cpp
      #include <memory> // problem with #define from .config
      namespace foo::bar{ int baz = 17; } // warning about nested namespaces being C++17
      

      Also Tools -> C++ -> Inspect C++ Code Model (or Ctrl-Shift-F12) -> "General" Tab shows CXX14

      This can be hacked around by editing src/plugins/projectexplorer/toolchain.cpp and making
      LanguageVersion ToolChain::cxxLanguageVersion(...) always return LanguageVersion::CXX17 or switching back to QtCreator 4.7. Removing __cplusplus from excludeDefineDirective() in compileroptionsbuilder.cpp does not help.

      1: https://codereview.qt-project.org/#/c/241267/
      2: https://codereview.qt-project.org/#/c/238480/
      3: https://bugreports.qt.io/browse/QTCREATORBUG-20884?focusedCommentId=422943&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-422943

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              kosjar Nikolai Kosjar
              tmmz Thomas Otto
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes