diff options
author | Nikolai Kosjar <nikolai.kosjar@qt.io> | 2018-09-27 10:18:44 +0200 |
---|---|---|
committer | Nikolai Kosjar <nikolai.kosjar@qt.io> | 2018-10-08 09:07:56 +0000 |
commit | 5900766ecb6aa25f363660c5ad2ef15777db5053 (patch) | |
tree | 1d6b10063dd286b16442e84e9fef11706f8a4c45 /src/plugins/projectexplorer/gcctoolchain.h | |
parent | 9192b6b024d9cdff1493e0d23fee43175825a59c (diff) | |
download | qt-creator-5900766ecb6aa25f363660c5ad2ef15777db5053.tar.gz |
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/projectexplorer/gcctoolchain.h')
-rw-r--r-- | src/plugins/projectexplorer/gcctoolchain.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/projectexplorer/gcctoolchain.h b/src/plugins/projectexplorer/gcctoolchain.h index 3458f63414..64e2acbe51 100644 --- a/src/plugins/projectexplorer/gcctoolchain.h +++ b/src/plugins/projectexplorer/gcctoolchain.h @@ -143,7 +143,7 @@ public: CompilerFlags compilerFlags(const QStringList &cxxflags) const override; WarningFlags warningFlags(const QStringList &cflags) const override; - PredefinedMacrosRunner createPredefinedMacrosRunner() const override; + MacroInspectionRunner createMacroInspectionRunner() const override; Macros predefinedMacros(const QStringList &cxxflags) const override; BuiltInHeaderPathsRunner createBuiltInHeaderPathsRunner() const override; @@ -253,7 +253,7 @@ private: mutable HeaderPaths m_headerPaths; mutable QString m_version; - mutable std::shared_ptr<Cache<QVector<Macro>, 64>> m_predefinedMacrosCache; + mutable std::shared_ptr<Cache<MacroInspectionReport, 64>> m_predefinedMacrosCache; mutable std::shared_ptr<Cache<HeaderPaths>> m_headerPathsCache; mutable ExtraHeaderPathsFunction m_extraHeaderPathsFunction = [](HeaderPaths &) {}; |