diff options
author | Ivan Donchevskii <ivan.donchevskii@qt.io> | 2018-01-02 15:26:08 +0100 |
---|---|---|
committer | Ivan Donchevskii <ivan.donchevskii@qt.io> | 2018-01-03 07:56:53 +0000 |
commit | b861e31f1a5eaeccf4053c87e8b307df5e1de66c (patch) | |
tree | fba1679934023aa6876b73db099b31619f9bbd3c /src/plugins/cpptools/compileroptionsbuilder.cpp | |
parent | 30bd05b792259a559e98c6a19035f7b6adaac1ce (diff) | |
download | qt-creator-b861e31f1a5eaeccf4053c87e8b307df5e1de66c.tar.gz |
Clang: macOS: fix unknown integer types
Always exclude clang include paths which do not come
with libclang used by code model.
This solves the issue with GCC that uses system clang
include folder on macOS.
Task-number: QTCREATORBUG-19397
Change-Id: I3b4845248a3cf03a95fbd4038856f8fb31346bfa
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Diffstat (limited to 'src/plugins/cpptools/compileroptionsbuilder.cpp')
-rw-r--r-- | src/plugins/cpptools/compileroptionsbuilder.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/plugins/cpptools/compileroptionsbuilder.cpp b/src/plugins/cpptools/compileroptionsbuilder.cpp index 914973bc44..43a4146218 100644 --- a/src/plugins/cpptools/compileroptionsbuilder.cpp +++ b/src/plugins/cpptools/compileroptionsbuilder.cpp @@ -440,16 +440,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) { - 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(); } } // namespace CppTools |