Skip to content

Commit 8248190

Browse files
committed
Fix clang-formatting for recent commits
1 parent af7e158 commit 8248190

File tree

2 files changed

+47
-34
lines changed

2 files changed

+47
-34
lines changed

clang/lib/ASTMatchers/ASTMatchFinder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ struct MatchKey {
6464
bool operator<(const MatchKey &Other) const {
6565
return std::tie(Traversal, MatcherID, Node, BoundNodes) <
6666
std::tie(Other.Traversal, Other.MatcherID, Other.Node,
67-
Other.BoundNodes);
67+
Other.BoundNodes);
6868
}
6969
};
7070

clang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp

Lines changed: 46 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1635,12 +1635,11 @@ void foo()
16351635

16361636
auto ParentMatcher = floatLiteral(hasParent(varDecl(hasName("i"))));
16371637

1638-
EXPECT_TRUE(
1639-
notMatches(VarDeclCode, traverse(ast_type_traits::TK_AsIs, ParentMatcher)));
1640-
EXPECT_TRUE(
1641-
matches(VarDeclCode,
1642-
traverse(ast_type_traits::TK_IgnoreUnlessSpelledInSource,
1643-
ParentMatcher)));
1638+
EXPECT_TRUE(notMatches(VarDeclCode,
1639+
traverse(ast_type_traits::TK_AsIs, ParentMatcher)));
1640+
EXPECT_TRUE(matches(VarDeclCode,
1641+
traverse(ast_type_traits::TK_IgnoreUnlessSpelledInSource,
1642+
ParentMatcher)));
16441643

16451644
EXPECT_TRUE(
16461645
matches(VarDeclCode, decl(traverse(ast_type_traits::TK_AsIs,
@@ -1723,12 +1722,13 @@ void bar()
17231722
functionDecl(hasName("foo"), traverse(ast_type_traits::TK_AsIs,
17241723
hasDescendant(floatLiteral())))));
17251724

1725+
EXPECT_TRUE(notMatches(Code, traverse(ast_type_traits::TK_AsIs,
1726+
floatLiteral(hasParent(callExpr(callee(
1727+
functionDecl(hasName("foo")))))))));
17261728
EXPECT_TRUE(
1727-
notMatches(Code, traverse(ast_type_traits::TK_AsIs, floatLiteral(hasParent(callExpr(callee(functionDecl(hasName("foo")))))))));
1728-
EXPECT_TRUE(
1729-
matches(Code,
1730-
traverse(ast_type_traits::TK_IgnoreUnlessSpelledInSource,
1731-
floatLiteral(hasParent(callExpr(callee(functionDecl(hasName("foo")))))))));
1729+
matches(Code, traverse(ast_type_traits::TK_IgnoreUnlessSpelledInSource,
1730+
floatLiteral(hasParent(callExpr(
1731+
callee(functionDecl(hasName("foo")))))))));
17321732

17331733
Code = R"cpp(
17341734
void foo()
@@ -1740,10 +1740,10 @@ void foo()
17401740
matches(Code,
17411741
traverse(ast_type_traits::TK_IgnoreUnlessSpelledInSource,
17421742
varDecl(hasInitializer(integerLiteral(equals(3)))))));
1743-
EXPECT_TRUE(
1744-
matches(Code,
1745-
traverse(ast_type_traits::TK_IgnoreUnlessSpelledInSource,
1746-
integerLiteral(equals(3), hasParent(varDecl(hasName("i")))))));
1743+
EXPECT_TRUE(matches(
1744+
Code,
1745+
traverse(ast_type_traits::TK_IgnoreUnlessSpelledInSource,
1746+
integerLiteral(equals(3), hasParent(varDecl(hasName("i")))))));
17471747
}
17481748

17491749
template <typename MatcherT>
@@ -1927,8 +1927,9 @@ void func14() {
19271927

19281928
EXPECT_TRUE(matches(
19291929
Code, traverse(ast_type_traits::TK_IgnoreUnlessSpelledInSource,
1930-
integerLiteral(equals(42), hasParent(returnStmt(forFunction(functionDecl(hasName("func1"))))))
1931-
)));
1930+
integerLiteral(equals(42),
1931+
hasParent(returnStmt(forFunction(
1932+
functionDecl(hasName("func1")))))))));
19321933

19331934
EXPECT_TRUE(matches(
19341935
Code,
@@ -1939,7 +1940,10 @@ void func14() {
19391940
EXPECT_TRUE(matches(
19401941
Code,
19411942
traverse(ast_type_traits::TK_IgnoreUnlessSpelledInSource,
1942-
integerLiteral(equals(42), hasParent(cxxTemporaryObjectExpr(hasParent(returnStmt(forFunction(functionDecl(hasName("func2")))))))))));
1943+
integerLiteral(
1944+
equals(42),
1945+
hasParent(cxxTemporaryObjectExpr(hasParent(returnStmt(
1946+
forFunction(functionDecl(hasName("func2")))))))))));
19431947

19441948
EXPECT_TRUE(matches(
19451949
Code, traverse(ast_type_traits::TK_IgnoreUnlessSpelledInSource,
@@ -1949,8 +1953,12 @@ void func14() {
19491953
integerLiteral(equals(42)))))))));
19501954

19511955
EXPECT_TRUE(matches(
1952-
Code, traverse(ast_type_traits::TK_IgnoreUnlessSpelledInSource,
1953-
integerLiteral(equals(42), hasParent(cxxFunctionalCastExpr(hasParent(returnStmt(forFunction(functionDecl(hasName("func3")))) )))))));
1956+
Code,
1957+
traverse(ast_type_traits::TK_IgnoreUnlessSpelledInSource,
1958+
integerLiteral(
1959+
equals(42),
1960+
hasParent(cxxFunctionalCastExpr(hasParent(returnStmt(
1961+
forFunction(functionDecl(hasName("func3")))))))))));
19541962

19551963
EXPECT_TRUE(matches(
19561964
Code, traverse(ast_type_traits::TK_IgnoreUnlessSpelledInSource,
@@ -1992,7 +2000,9 @@ void func14() {
19922000

19932001
EXPECT_TRUE(matches(
19942002
Code, traverse(ast_type_traits::TK_IgnoreUnlessSpelledInSource,
1995-
declRefExpr(to(varDecl(hasName("a"))), hasParent(returnStmt(forFunction(functionDecl(hasName("func10")))))))));
2003+
declRefExpr(to(varDecl(hasName("a"))),
2004+
hasParent(returnStmt(forFunction(
2005+
functionDecl(hasName("func10")))))))));
19962006

19972007
EXPECT_TRUE(matches(
19982008
Code, traverse(ast_type_traits::TK_IgnoreUnlessSpelledInSource,
@@ -2002,8 +2012,9 @@ void func14() {
20022012

20032013
EXPECT_TRUE(matches(
20042014
Code, traverse(ast_type_traits::TK_IgnoreUnlessSpelledInSource,
2005-
declRefExpr(to(varDecl(hasName("b"))), hasParent(returnStmt(forFunction(functionDecl(hasName("func11"))))))
2006-
)));
2015+
declRefExpr(to(varDecl(hasName("b"))),
2016+
hasParent(returnStmt(forFunction(
2017+
functionDecl(hasName("func11")))))))));
20072018

20082019
EXPECT_TRUE(matches(
20092020
Code, traverse(ast_type_traits::TK_IgnoreUnlessSpelledInSource,
@@ -2013,8 +2024,9 @@ void func14() {
20132024

20142025
EXPECT_TRUE(matches(
20152026
Code, traverse(ast_type_traits::TK_IgnoreUnlessSpelledInSource,
2016-
declRefExpr(to(varDecl(hasName("c"))), hasParent(returnStmt(forFunction(functionDecl(hasName("func12"))))))
2017-
)));
2027+
declRefExpr(to(varDecl(hasName("c"))),
2028+
hasParent(returnStmt(forFunction(
2029+
functionDecl(hasName("func12")))))))));
20182030

20192031
EXPECT_TRUE(matches(
20202032
Code,
@@ -2028,17 +2040,18 @@ void func14() {
20282040
has(parmVarDecl(hasName("d")))))));
20292041

20302042
EXPECT_TRUE(matches(
2031-
Code,
2032-
traverse(
2033-
ast_type_traits::TK_IgnoreUnlessSpelledInSource,
2034-
declRefExpr(to(varDecl(hasName("a"))), hasParent( lambdaExpr(forFunction(functionDecl(hasName("func13")))) )))));
2043+
Code, traverse(ast_type_traits::TK_IgnoreUnlessSpelledInSource,
2044+
declRefExpr(to(varDecl(hasName("a"))),
2045+
hasParent(lambdaExpr(forFunction(
2046+
functionDecl(hasName("func13")))))))));
20352047

20362048
EXPECT_TRUE(matches(
20372049
Code,
2038-
traverse(
2039-
ast_type_traits::TK_IgnoreUnlessSpelledInSource,
2040-
varDecl(hasName("b"), hasInitializer(declRefExpr(to(
2041-
varDecl(hasName("c"))))), hasParent( lambdaExpr(forFunction(functionDecl(hasName("func13")))) )))));
2050+
traverse(ast_type_traits::TK_IgnoreUnlessSpelledInSource,
2051+
varDecl(hasName("b"),
2052+
hasInitializer(declRefExpr(to(varDecl(hasName("c"))))),
2053+
hasParent(lambdaExpr(
2054+
forFunction(functionDecl(hasName("func13")))))))));
20422055

20432056
EXPECT_TRUE(matches(
20442057
Code, traverse(ast_type_traits::TK_IgnoreUnlessSpelledInSource,

0 commit comments

Comments
 (0)