Clang: Fix excluded Clang path regular expression

Cover cases like /usr/lib64/clang/6.0.0/include

Change-Id: I015ea3535637376eeab6f737752ad13d33887190
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
Ivan Donchevskii
2018-08-23 15:51:56 +02:00
parent 468e71cbe4
commit 6652d937aa

View File

@@ -505,7 +505,7 @@ bool CompilerOptionsBuilder::excludeHeaderPath(const QString &headerPath) const
// 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"));
QLatin1String("\\A.*[\\/\\\\]lib\\d*[\\/\\\\]clang[\\/\\\\]\\d+\\.\\d+(\\.\\d+)?[\\/\\\\]include\\z"));
return clangIncludeDir.match(headerPath).hasMatch();
}