summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/compileroptionsbuilder.cpp
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2018-01-09 13:07:57 +0100
committerEike Ziller <eike.ziller@qt.io>2018-01-09 13:13:00 +0100
commitcff2cc90e21c7ef4d363d459be9ad6cf17b9b494 (patch)
treefc37439466f7ccf6a8bbfc4bb64e1ab21bfa4c21 /src/plugins/cpptools/compileroptionsbuilder.cpp
parentb1239d6c4c77814c62598469bc1588b43c690acc (diff)
parent32786ea9cadb4329b09dae2f825e61dcbd9fcc75 (diff)
downloadqt-creator-cff2cc90e21c7ef4d363d459be9ad6cf17b9b494.tar.gz
Merge remote-tracking branch 'origin/4.5'
Conflicts: src/plugins/cpptools/clangcompileroptionsbuilder.cpp src/plugins/cpptools/clangcompileroptionsbuilder.h src/plugins/cpptools/compileroptionsbuilder.cpp src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp src/plugins/qmlprofiler/qmlprofilerclientmanager.h src/plugins/qmlprofiler/qmlprofilertraceclient.cpp src/plugins/qmlprofiler/qmlprofilertraceclient.h src/shared/qbs Change-Id: I364ababc5d41046d17e999096c4a7187c4e4e010
Diffstat (limited to 'src/plugins/cpptools/compileroptionsbuilder.cpp')
-rw-r--r--src/plugins/cpptools/compileroptionsbuilder.cpp19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/plugins/cpptools/compileroptionsbuilder.cpp b/src/plugins/cpptools/compileroptionsbuilder.cpp
index 9f11c02bb9..8164009bf1 100644
--- a/src/plugins/cpptools/compileroptionsbuilder.cpp
+++ b/src/plugins/cpptools/compileroptionsbuilder.cpp
@@ -473,18 +473,13 @@ bool CompilerOptionsBuilder::excludeDefineDirective(const ProjectExplorer::Macro
bool CompilerOptionsBuilder::excludeHeaderPath(const QString &headerPath) const
{
- // A clang tool chain might have another version and passing in the
- // intrinsics path from that version will lead to errors (unknown
- // intrinsics, unfavorable order with regard to include_next).
- if (m_projectPart.toolchainType == ProjectExplorer::Constants::CLANG_TOOLCHAIN_TYPEID) {
- if (headerPath.contains("lib/gcc/i686-apple-darwin"))
- return true;
- static QRegularExpression clangIncludeDir(
- QLatin1String("\\A.*/lib/clang/\\d+\\.\\d+(\\.\\d+)?/include\\z"));
- return clangIncludeDir.match(headerPath).hasMatch();
- }
-
- return false;
+ // Always exclude clang system includes (including intrinsics) which do not come with libclang
+ // that Qt Creator uses for code model.
+ // For example GCC on macOS uses system clang include path which makes clang code model
+ // include incorrect system headers.
+ static QRegularExpression clangIncludeDir(
+ QLatin1String("\\A.*/lib/clang/\\d+\\.\\d+(\\.\\d+)?/include\\z"));
+ return clangIncludeDir.match(headerPath).hasMatch();
}
void CompilerOptionsBuilder::addPredefinedHeaderPathsOptions()