Commit 8248190a authored by Stephen Kelly's avatar Stephen Kelly
Browse files

Fix clang-formatting for recent commits

parent af7e1588
Loading
Loading
Loading
Loading
+46 −33
Original line number Diff line number Diff line
@@ -1635,10 +1635,9 @@ void foo()

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

  EXPECT_TRUE(
      notMatches(VarDeclCode, traverse(ast_type_traits::TK_AsIs, ParentMatcher)));
  EXPECT_TRUE(
      matches(VarDeclCode,
  EXPECT_TRUE(notMatches(VarDeclCode,
                         traverse(ast_type_traits::TK_AsIs, ParentMatcher)));
  EXPECT_TRUE(matches(VarDeclCode,
                      traverse(ast_type_traits::TK_IgnoreUnlessSpelledInSource,
                               ParentMatcher)));

@@ -1723,12 +1722,13 @@ void bar()
      functionDecl(hasName("foo"), traverse(ast_type_traits::TK_AsIs,
                                            hasDescendant(floatLiteral())))));

  EXPECT_TRUE(notMatches(Code, traverse(ast_type_traits::TK_AsIs,
                                        floatLiteral(hasParent(callExpr(callee(
                                            functionDecl(hasName("foo")))))))));
  EXPECT_TRUE(
      notMatches(Code, traverse(ast_type_traits::TK_AsIs, floatLiteral(hasParent(callExpr(callee(functionDecl(hasName("foo")))))))));
  EXPECT_TRUE(
      matches(Code,
              traverse(ast_type_traits::TK_IgnoreUnlessSpelledInSource,
                       floatLiteral(hasParent(callExpr(callee(functionDecl(hasName("foo")))))))));
      matches(Code, traverse(ast_type_traits::TK_IgnoreUnlessSpelledInSource,
                             floatLiteral(hasParent(callExpr(
                                 callee(functionDecl(hasName("foo")))))))));

  Code = R"cpp(
void foo()
@@ -1740,8 +1740,8 @@ void foo()
      matches(Code,
              traverse(ast_type_traits::TK_IgnoreUnlessSpelledInSource,
                       varDecl(hasInitializer(integerLiteral(equals(3)))))));
  EXPECT_TRUE(
      matches(Code,
  EXPECT_TRUE(matches(
      Code,
      traverse(ast_type_traits::TK_IgnoreUnlessSpelledInSource,
               integerLiteral(equals(3), hasParent(varDecl(hasName("i")))))));
}
@@ -1927,8 +1927,9 @@ void func14() {

  EXPECT_TRUE(matches(
      Code, traverse(ast_type_traits::TK_IgnoreUnlessSpelledInSource,
        integerLiteral(equals(42), hasParent(returnStmt(forFunction(functionDecl(hasName("func1"))))))
                     )));
                     integerLiteral(equals(42),
                                    hasParent(returnStmt(forFunction(
                                        functionDecl(hasName("func1")))))))));

  EXPECT_TRUE(matches(
      Code,
@@ -1939,7 +1940,10 @@ void func14() {
  EXPECT_TRUE(matches(
      Code,
      traverse(ast_type_traits::TK_IgnoreUnlessSpelledInSource,
        integerLiteral(equals(42), hasParent(cxxTemporaryObjectExpr(hasParent(returnStmt(forFunction(functionDecl(hasName("func2")))))))))));
               integerLiteral(
                   equals(42),
                   hasParent(cxxTemporaryObjectExpr(hasParent(returnStmt(
                       forFunction(functionDecl(hasName("func2")))))))))));

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

  EXPECT_TRUE(matches(
      Code, traverse(ast_type_traits::TK_IgnoreUnlessSpelledInSource,
        integerLiteral(equals(42), hasParent(cxxFunctionalCastExpr(hasParent(returnStmt(forFunction(functionDecl(hasName("func3")))) )))))));
      Code,
      traverse(ast_type_traits::TK_IgnoreUnlessSpelledInSource,
               integerLiteral(
                   equals(42),
                   hasParent(cxxFunctionalCastExpr(hasParent(returnStmt(
                       forFunction(functionDecl(hasName("func3")))))))))));

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

  EXPECT_TRUE(matches(
      Code, traverse(ast_type_traits::TK_IgnoreUnlessSpelledInSource,
        declRefExpr(to(varDecl(hasName("a"))), hasParent(returnStmt(forFunction(functionDecl(hasName("func10")))))))));
                     declRefExpr(to(varDecl(hasName("a"))),
                                 hasParent(returnStmt(forFunction(
                                     functionDecl(hasName("func10")))))))));

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

  EXPECT_TRUE(matches(
      Code, traverse(ast_type_traits::TK_IgnoreUnlessSpelledInSource,
        declRefExpr(to(varDecl(hasName("b"))), hasParent(returnStmt(forFunction(functionDecl(hasName("func11"))))))
                     )));
                     declRefExpr(to(varDecl(hasName("b"))),
                                 hasParent(returnStmt(forFunction(
                                     functionDecl(hasName("func11")))))))));

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

  EXPECT_TRUE(matches(
      Code, traverse(ast_type_traits::TK_IgnoreUnlessSpelledInSource,
        declRefExpr(to(varDecl(hasName("c"))), hasParent(returnStmt(forFunction(functionDecl(hasName("func12"))))))
                     )));
                     declRefExpr(to(varDecl(hasName("c"))),
                                 hasParent(returnStmt(forFunction(
                                     functionDecl(hasName("func12")))))))));

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

  EXPECT_TRUE(matches(
      Code,
      traverse(
          ast_type_traits::TK_IgnoreUnlessSpelledInSource,
          declRefExpr(to(varDecl(hasName("a"))), hasParent( lambdaExpr(forFunction(functionDecl(hasName("func13")))) )))));
      Code, traverse(ast_type_traits::TK_IgnoreUnlessSpelledInSource,
                     declRefExpr(to(varDecl(hasName("a"))),
                                 hasParent(lambdaExpr(forFunction(
                                     functionDecl(hasName("func13")))))))));

  EXPECT_TRUE(matches(
      Code,
      traverse(
          ast_type_traits::TK_IgnoreUnlessSpelledInSource,
          varDecl(hasName("b"), hasInitializer(declRefExpr(to(
                                                   varDecl(hasName("c"))))), hasParent( lambdaExpr(forFunction(functionDecl(hasName("func13")))) )))));
      traverse(ast_type_traits::TK_IgnoreUnlessSpelledInSource,
               varDecl(hasName("b"),
                       hasInitializer(declRefExpr(to(varDecl(hasName("c"))))),
                       hasParent(lambdaExpr(
                           forFunction(functionDecl(hasName("func13")))))))));

  EXPECT_TRUE(matches(
      Code, traverse(ast_type_traits::TK_IgnoreUnlessSpelledInSource,
+1 −1

File changed.

Contains only whitespace changes.