aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikolai Kosjar <nikolai.kosjar@qt.io>2019-10-11 09:16:12 +0200
committerNikolai Kosjar <nikolai.kosjar@qt.io>2019-10-11 12:50:03 +0000
commit85b45920fb1c83b6e9c9cc409fc90df0a83f668d (patch)
tree65d090b5e243fbcc9fd2fd8c925d53b33218e3c5
parent5165c037ebbc3948d777595610bc62beb275a9a8 (diff)
Clang: Simplify regex patterns
...by removing pointless backslashes. '/' is not meta character, therefore escaping it with a backslash is not needed. Change-Id: Ic0bd1f85b3eed721cad67f4b4d616352ea9e098a Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
-rw-r--r--src/plugins/cpptools/headerpathfilter.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/plugins/cpptools/headerpathfilter.cpp b/src/plugins/cpptools/headerpathfilter.cpp
index 6c2d57fc68..da200d0321 100644
--- a/src/plugins/cpptools/headerpathfilter.cpp
+++ b/src/plugins/cpptools/headerpathfilter.cpp
@@ -123,14 +123,14 @@ QString clangIncludeDirectory(const QString &clangVersion, const QString &clangR
HeaderPaths::iterator resourceIterator(HeaderPaths &headerPaths, bool isMacOs)
{
// include/c++, include/g++, libc++\include and libc++abi\include
- static const QString cppIncludes = R"((.*\/include\/.*(g\+\+|c\+\+).*))"
- R"(|(.*libc\+\+\/include))"
- R"(|(.*libc\+\+abi\/include))";
+ static const QString cppIncludes = R"((.*/include/.*(g\+\+|c\+\+).*))"
+ R"(|(.*libc\+\+/include))"
+ R"(|(.*libc\+\+abi/include))";
static const QRegularExpression includeRegExp("\\A(" + cppIncludes + ")\\z");
// The same as includeRegExp but also matches /usr/local/include
static const QRegularExpression includeRegExpMac("\\A(" + cppIncludes
- + R"(|(\/usr\/local\/include))" + ")\\z");
+ + R"(|(/usr/local/include))" + ")\\z");
const QRegularExpression &includePathRegEx = isMacOs ? includeRegExpMac : includeRegExp;
@@ -148,7 +148,7 @@ bool isClangSystemHeaderPath(const HeaderPath &headerPath)
// For example GCC on macOS uses system clang include path which makes clang code model
// include incorrect system headers.
static const QRegularExpression clangIncludeDir(
- R"(\A.*\/lib\d*\/clang\/\d+\.\d+(\.\d+)?\/include\z)");
+ R"(\A.*/lib\d*/clang/\d+\.\d+(\.\d+)?/include\z)");
return clangIncludeDir.match(headerPath.path).hasMatch();
}