Skip to content

Commit 5af7679

Browse files
authored
Fix calls to PrintedDeclCXX98Matches. (#86741)
Fix the calls to `PrintedDeclCXX98Matches` to take the lambda function as the last argument.
1 parent 80aa52d commit 5af7679

File tree

1 file changed

+29
-25
lines changed

1 file changed

+29
-25
lines changed

clang/unittests/AST/DeclPrinterTest.cpp

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1387,34 +1387,38 @@ TEST(DeclPrinter, TestTemplateArgumentList16) {
13871387
}
13881388

13891389
TEST(DeclPrinter, TestCXXRecordDecl17) {
1390-
ASSERT_TRUE(PrintedDeclCXX98Matches("template<typename T> struct Z {};"
1391-
"struct X {};"
1392-
"Z<X> A;",
1393-
"A", "Z<X> A"));
1394-
(void)[](PrintingPolicy &Policy) { Policy.SuppressTagKeyword = false; };
1390+
ASSERT_TRUE(PrintedDeclCXX98Matches(
1391+
"template<typename T> struct Z {};"
1392+
"struct X {};"
1393+
"Z<X> A;",
1394+
"A", "Z<X> A",
1395+
[](PrintingPolicy &Policy) { Policy.SuppressTagKeyword = false; }));
13951396
}
13961397

13971398
TEST(DeclPrinter, TestCXXRecordDecl18) {
1398-
ASSERT_TRUE(PrintedDeclCXX98Matches("template<typename T> struct Z {};"
1399-
"struct X {};"
1400-
"Z<X> A;"
1401-
"template <typename T1, int>"
1402-
"struct Y{};"
1403-
"Y<Z<X>, 2> B;",
1404-
"B", "Y<Z<X>, 2> B"));
1405-
(void)[](PrintingPolicy &Policy) { Policy.SuppressTagKeyword = false; };
1399+
ASSERT_TRUE(PrintedDeclCXX98Matches(
1400+
"template<typename T> struct Z {};"
1401+
"struct X {};"
1402+
"Z<X> A;"
1403+
"template <typename T1, int>"
1404+
"struct Y{};"
1405+
"Y<Z<X>, 2> B;",
1406+
"B", "Y<Z<X>, 2> B",
1407+
[](PrintingPolicy &Policy) { Policy.SuppressTagKeyword = false; }));
14061408
}
14071409

14081410
TEST(DeclPrinter, TestCXXRecordDecl19) {
1409-
ASSERT_TRUE(PrintedDeclCXX98Matches("template<typename T> struct Z {};"
1410-
"struct X {};"
1411-
"Z<X> A;"
1412-
"template <typename T1, int>"
1413-
"struct Y{};"
1414-
"Y<Z<X>, 2> B;",
1415-
"B", "Y<Z<X>, 2> B"));
1416-
(void)[](PrintingPolicy &Policy) { Policy.SuppressTagKeyword = true; };
1411+
ASSERT_TRUE(PrintedDeclCXX98Matches(
1412+
"template<typename T> struct Z {};"
1413+
"struct X {};"
1414+
"Z<X> A;"
1415+
"template <typename T1, int>"
1416+
"struct Y{};"
1417+
"Y<Z<X>, 2> B;",
1418+
"B", "Y<Z<X>, 2> B",
1419+
[](PrintingPolicy &Policy) { Policy.SuppressTagKeyword = true; }));
14171420
}
1421+
14181422
TEST(DeclPrinter, TestCXXRecordDecl20) {
14191423
ASSERT_TRUE(PrintedDeclCXX98Matches(
14201424
"template <typename T, int N> class Inner;"
@@ -1431,8 +1435,8 @@ TEST(DeclPrinter, TestCXXRecordDecl20) {
14311435
"};"
14321436
"Outer<Inner<int, 10>, 5>::NestedStruct nestedInstance(100);",
14331437
"nestedInstance",
1434-
"Outer<Inner<int, 10>, 5>::NestedStruct nestedInstance(100)"));
1435-
(void)[](PrintingPolicy &Policy) { Policy.SuppressTagKeyword = false; };
1438+
"Outer<Inner<int, 10>, 5>::NestedStruct nestedInstance(100)",
1439+
[](PrintingPolicy &Policy) { Policy.SuppressTagKeyword = false; }));
14361440
}
14371441

14381442
TEST(DeclPrinter, TestCXXRecordDecl21) {
@@ -1451,8 +1455,8 @@ TEST(DeclPrinter, TestCXXRecordDecl21) {
14511455
"};"
14521456
"Outer<Inner<int, 10>, 5>::NestedStruct nestedInstance(100);",
14531457
"nestedInstance",
1454-
"Outer<Inner<int, 10>, 5>::NestedStruct nestedInstance(100)"));
1455-
(void)[](PrintingPolicy &Policy) { Policy.SuppressTagKeyword = true; };
1458+
"Outer<Inner<int, 10>, 5>::NestedStruct nestedInstance(100)",
1459+
[](PrintingPolicy &Policy) { Policy.SuppressTagKeyword = true; }));
14561460
}
14571461

14581462
TEST(DeclPrinter, TestFunctionParamUglified) {

0 commit comments

Comments
 (0)