aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/autotoolsprojectmanager
diff options
context:
space:
mode:
authorNikolai Kosjar <nikolai.kosjar@qt.io>2018-09-27 10:18:44 +0200
committerNikolai Kosjar <nikolai.kosjar@qt.io>2018-10-08 09:07:56 +0000
commit5900766ecb6aa25f363660c5ad2ef15777db5053 (patch)
tree1d6b10063dd286b16442e84e9fef11706f8a4c45 /src/plugins/autotoolsprojectmanager
parent9192b6b024d9cdff1493e0d23fee43175825a59c (diff)
Toolchains: Detect unspecified language version
We checked the command line from the project manager for "-std=X" and friends to figure out the language version to use. However, if such a flag was not provided, we assumed the latest version we support. This could conflict with the actual version of the compiler and its predefined macros. Figure out the version by inspecting __cplusplus/__STDC_VERSION__ in the predefined macros of the toolchain. The MSVC compiler is an exception to this, as it does not seem to properly set the value - check for _MSVC_LANG if possible, otherwise simply assume some versions as before. While at it, add also support for C17/C18 and the upcoming C++2a. Task-number: QTCREATORBUG-20884 Task-number: QTCREATORBUG-21188 Change-Id: I464ffcd52d2120c0208275a050e82efda44fae1c Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Diffstat (limited to 'src/plugins/autotoolsprojectmanager')
-rw-r--r--src/plugins/autotoolsprojectmanager/autotoolsproject.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/plugins/autotoolsprojectmanager/autotoolsproject.cpp b/src/plugins/autotoolsprojectmanager/autotoolsproject.cpp
index c211fcc471..fc4850b84f 100644
--- a/src/plugins/autotoolsprojectmanager/autotoolsproject.cpp
+++ b/src/plugins/autotoolsprojectmanager/autotoolsproject.cpp
@@ -276,10 +276,8 @@ void AutotoolsProject::updateCppCodeModel()
CppTools::ProjectPart::QtVersion activeQtVersion = CppTools::ProjectPart::NoQt;
if (QtSupport::BaseQtVersion *qtVersion = QtSupport::QtKitInformation::qtVersion(k)) {
- if (qtVersion->qtVersion() <= QtSupport::QtVersionNumber(4,8,6))
- activeQtVersion = CppTools::ProjectPart::Qt4_8_6AndOlder;
- else if (qtVersion->qtVersion() < QtSupport::QtVersionNumber(5,0,0))
- activeQtVersion = CppTools::ProjectPart::Qt4Latest;
+ if (qtVersion->qtVersion() < QtSupport::QtVersionNumber(5,0,0))
+ activeQtVersion = CppTools::ProjectPart::Qt4;
else
activeQtVersion = CppTools::ProjectPart::Qt5;
}