diff options
Diffstat (limited to 'src/plugins/cpptools/compileroptionsbuilder.cpp')
-rw-r--r-- | src/plugins/cpptools/compileroptionsbuilder.cpp | 19 |
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() |