summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Donchevskii <ivan.donchevskii@qt.io>2018-04-24 13:42:18 +0200
committerIvan Donchevskii <ivan.donchevskii@qt.io>2019-04-03 11:53:00 +0000
commitdbad1d6045eacf61a469d955b50448c3238bca02 (patch)
treea0e3e48881f5b51a3d03cefb9ebeca5cb92154bf
parent203792195ecacdec8e0bbead9255f89838e442af (diff)
Fix mingw libclang buildrelease_80-based
Mingw miscompiles one of the static variables in Clang-Tidy which results in clang driver wrong return codes. Making it a local static variable solves the issue. This is a cherry pick from commit 47f19b1a8800c914b11560b86d92d25b5fe47e80 Change-Id: I0851a8f2135089b4d59d0d6b396d4aa27e22cc1e Reviewed-by: Orgad Shaneh <orgads@gmail.com>
-rw-r--r--clang-tidy/modernize/LoopConvertCheck.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/clang-tidy/modernize/LoopConvertCheck.cpp b/clang-tidy/modernize/LoopConvertCheck.cpp
index aa11b71a..e6b22d17 100644
--- a/clang-tidy/modernize/LoopConvertCheck.cpp
+++ b/clang-tidy/modernize/LoopConvertCheck.cpp
@@ -44,9 +44,6 @@ static const char EndVarName[] = "endVar";
static const char DerefByValueResultName[] = "derefByValueResult";
static const char DerefByRefResultName[] = "derefByRefResult";
-// shared matchers
-static const TypeMatcher AnyType = anything();
-
static const StatementMatcher IntegerComparisonMatcher =
expr(ignoringParenImpCasts(
declRefExpr(to(varDecl(hasType(isInteger())).bind(ConditionVarName)))));
@@ -174,6 +171,8 @@ StatementMatcher makeIteratorLoopMatcher() {
qualType(unless(hasCanonicalType(rValueReferenceType())))
.bind(DerefByRefResultName))))))))));
+ static const TypeMatcher AnyType = anything();
+
return forStmt(
unless(isInTemplateInstantiation()),
hasLoopInit(anyOf(declStmt(declCountIs(2),