[clang] d7ddad4 - Reformat CastExpr unittest suite; NFC

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 7 06:22:16 PST 2022


Author: Kim Gräsman
Date: 2022-02-07T09:21:41-05:00
New Revision: d7ddad408f5b64df39a39f4af3a631275961b975

URL: https://github.com/llvm/llvm-project/commit/d7ddad408f5b64df39a39f4af3a631275961b975
DIFF: https://github.com/llvm/llvm-project/commit/d7ddad408f5b64df39a39f4af3a631275961b975.diff

LOG: Reformat CastExpr unittest suite; NFC

In preparation for adding new tests. No functional change.

Added: 
    

Modified: 
    clang/unittests/Tooling/CastExprTest.cpp

Removed: 
    


################################################################################
diff  --git a/clang/unittests/Tooling/CastExprTest.cpp b/clang/unittests/Tooling/CastExprTest.cpp
index cda963a6a897..a07eff36afb0 100644
--- a/clang/unittests/Tooling/CastExprTest.cpp
+++ b/clang/unittests/Tooling/CastExprTest.cpp
@@ -23,15 +23,15 @@ struct CastExprVisitor : TestVisitor<CastExprVisitor> {
 };
 
 TEST(CastExprTest, GetSubExprAsWrittenThroughMaterializedTemporary) {
-    CastExprVisitor Visitor;
-    Visitor.OnExplicitCast = [](ExplicitCastExpr *Expr) {
-      auto Sub = Expr->getSubExprAsWritten();
-      EXPECT_TRUE(isa<DeclRefExpr>(Sub))
+  CastExprVisitor Visitor;
+  Visitor.OnExplicitCast = [](ExplicitCastExpr *Expr) {
+    auto Sub = Expr->getSubExprAsWritten();
+    EXPECT_TRUE(isa<DeclRefExpr>(Sub))
         << "Expected DeclRefExpr, but saw " << Sub->getStmtClassName();
-    };
-    Visitor.runOver("struct S1 {};\n"
-                    "struct S2 { operator S1(); };\n"
-                    "S1 f(S2 s) { return static_cast<S1>(s); }\n");
+  };
+  Visitor.runOver("struct S1 {};\n"
+                  "struct S2 { operator S1(); };\n"
+                  "S1 f(S2 s) { return static_cast<S1>(s); }\n");
 }
 
 // Verify that getSubExprAsWritten looks through a ConstantExpr in a scenario
@@ -43,15 +43,15 @@ TEST(CastExprTest, GetSubExprAsWrittenThroughMaterializedTemporary) {
 //     `-CXXConstructExpr 'S' 'void (int)'
 //       `-IntegerLiteral 'int' 0
 TEST(CastExprTest, GetSubExprAsWrittenThroughConstantExpr) {
-    CastExprVisitor Visitor;
-    Visitor.OnExplicitCast = [](ExplicitCastExpr *Expr) {
-      auto *Sub = Expr->getSubExprAsWritten();
-      EXPECT_TRUE(isa<IntegerLiteral>(Sub))
+  CastExprVisitor Visitor;
+  Visitor.OnExplicitCast = [](ExplicitCastExpr *Expr) {
+    auto *Sub = Expr->getSubExprAsWritten();
+    EXPECT_TRUE(isa<IntegerLiteral>(Sub))
         << "Expected IntegerLiteral, but saw " << Sub->getStmtClassName();
-    };
-    Visitor.runOver("struct S { consteval S(int) {} };\n"
-                    "S f() { return S(0); }\n",
-                    CastExprVisitor::Lang_CXX2a);
+  };
+  Visitor.runOver("struct S { consteval S(int) {} };\n"
+                  "S f() { return S(0); }\n",
+                  CastExprVisitor::Lang_CXX2a);
 }
 
-}
+} // namespace


        


More information about the cfe-commits mailing list