diff options
author | Nikolai Kosjar <nikolai.kosjar@qt.io> | 2016-10-10 17:31:19 +0200 |
---|---|---|
committer | Nikolai Kosjar <nikolai.kosjar@qt.io> | 2016-10-13 10:17:58 +0000 |
commit | 6884ab080e28699ca662878d7083cd84b9f206d4 (patch) | |
tree | a00e775540fcd16d38da0ee1cc0fd52173d1a351 /src/plugins/clangrefactoring/refactoringcompileroptionsbuilder.cpp | |
parent | 3d68a8d0dec033eebef7d0ead082a291afa9454d (diff) | |
download | qt-creator-6884ab080e28699ca662878d7083cd84b9f206d4.tar.gz |
ClangStaticAnalyzer: Fix path for intrinsics for clang toolchains
Ignore the include path for intrinsics coming from the toolchain. The
clang static analyzer comes with its own intrinsics and does not cope
well with intrinsics from other clang versions.
Move the relevant implementation from LibClangOptionsBuilder into the
base class so that ClangStaticAnalyzer profits from this, too.
Task-number: QTCREATORBUG-17102
Change-Id: Id9a28ddebb889c862939332dce888a80b3bb7e63
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins/clangrefactoring/refactoringcompileroptionsbuilder.cpp')
-rw-r--r-- | src/plugins/clangrefactoring/refactoringcompileroptionsbuilder.cpp | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/src/plugins/clangrefactoring/refactoringcompileroptionsbuilder.cpp b/src/plugins/clangrefactoring/refactoringcompileroptionsbuilder.cpp index 6546e9b950..372cf1af15 100644 --- a/src/plugins/clangrefactoring/refactoringcompileroptionsbuilder.cpp +++ b/src/plugins/clangrefactoring/refactoringcompileroptionsbuilder.cpp @@ -56,18 +56,12 @@ RefactoringCompilerOptionsBuilder::RefactoringCompilerOptionsBuilder(CppTools::P bool RefactoringCompilerOptionsBuilder::excludeHeaderPath(const QString &path) const { - if (path.contains(QLatin1String("lib/gcc/i686-apple-darwin"))) - return true; - - // We already provide a custom clang include path matching the used libclang version, - // so better ignore the clang include paths from the system as this might lead to an - // unfavorable order with regard to include_next. - static QRegularExpression clangIncludeDir( - QLatin1String("\\A.*/lib/clang/\\d+\\.\\d+(\\.\\d+)?/include\\z")); - if (clangIncludeDir.match(path).hasMatch()) - return true; - - return false; + if (m_projectPart.toolchainType == ProjectExplorer::Constants::CLANG_TOOLCHAIN_TYPEID) { + if (path.contains(QLatin1String("lib/gcc/i686-apple-darwin"))) + return true; + } + + return CompilerOptionsBuilder::excludeHeaderPath(path); } void RefactoringCompilerOptionsBuilder::addPredefinedMacrosAndHeaderPathsOptions() |