[PATCH] D117390: [AST] Reformat CastExpr unittest suite
Kim Gräsman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sat Jan 15 02:16:20 PST 2022
kimgr created this revision.
kimgr requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
In preparation for adding new tests. No functional change.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D117390
Files:
clang/unittests/Tooling/CastExprTest.cpp
Index: clang/unittests/Tooling/CastExprTest.cpp
===================================================================
--- clang/unittests/Tooling/CastExprTest.cpp
+++ clang/unittests/Tooling/CastExprTest.cpp
@@ -23,15 +23,15 @@
};
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 @@
// `-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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D117390.400264.patch
Type: text/x-patch
Size: 2085 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220115/25f0d77d/attachment.bin>
More information about the cfe-commits
mailing list