Details
-
Bug
-
Resolution: Duplicate
-
Not Evaluated
-
None
-
Qt Creator 4.8.0
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
- duplicates
-
QTCREATORBUG-19668 Cannot specify language version for Clang Code Model for Generic Project
-
- Closed
-