summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntoine Poliakov <antoinep92@gmail.com>2016-05-27 14:38:22 +0200
committerAntoine Poliakov <antoinep92@gmail.com>2016-06-20 10:04:11 +0000
commitab3e5d0ed1f43db721de877e11b472fb79816c41 (patch)
tree5aae637f0e7a4ff817fa0ab9b23dcb80f47678dc
parentfad1f14d64007feba2443493f6d9d2c4d9734fd4 (diff)
downloadqt-creator-ab3e5d0ed1f43db721de877e11b472fb79816c41.tar.gz
Toolchain: Fix -std=gnu++XX gcc/clang option parsing
Now -std=gnu++XX is handled like -std=c++XX In particular, gnu++1y is correctly mapped to StandardCxx14 instead of StandardCxx11, and gnu++14, gnu++17 and gnu++1z are recognized. This makes clang static analyzer plugin for for C++14/17 code bases. Task-number: QTCREATORBUG-16290 Change-Id: I2018b9a365bb0a9cae7573b4e4f74deb830a7758 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io> Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
-rw-r--r--src/plugins/projectexplorer/gcctoolchain.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp
index cba2ad3a74..dd055755ae 100644
--- a/src/plugins/projectexplorer/gcctoolchain.cpp
+++ b/src/plugins/projectexplorer/gcctoolchain.cpp
@@ -431,9 +431,15 @@ ToolChain::CompilerFlags GccToolChain::compilerFlags(const QStringList &cxxflags
} else if (std == "c++17" || std == "c++1z") {
flags |= StandardCxx17;
flags &= ~CompilerFlags(StandardCxx11 | StandardCxx14 | GnuExtensions);
- } else if (std == "gnu++0x" || std == "gnu++11" || std== "gnu++1y") {
+ } else if (std == "gnu++0x" || std == "gnu++11") {
flags |= CompilerFlags(StandardCxx11 | GnuExtensions);
flags &= ~CompilerFlags(StandardCxx14 | StandardCxx17);
+ } else if (std== "gnu++14" || std == "gnu++1y") {
+ flags |= CompilerFlags(StandardCxx14 | GnuExtensions);
+ flags &= ~CompilerFlags(StandardCxx11 | StandardCxx17);
+ } else if (std== "gnu++17" || std == "gnu++1z") {
+ flags |= CompilerFlags(StandardCxx17 | GnuExtensions);
+ flags &= ~CompilerFlags(StandardCxx11 | StandardCxx14);
} else if (std == "c89" || std == "c90"
|| std == "iso9899:1990" || std == "iso9899:199409") {
flags &= ~CompilerFlags(StandardC99 | StandardC11);