diff options
author | Zahira Ammarguellat <zahira.ammarguellat@intel.com> | 2024-03-29 03:35:22 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-29 06:35:22 -0400 |
commit | 5af767926288f837e4fd9fd81a9d4878e0924ced (patch) | |
tree | fb3a4464929eb6f4949b4211e1984dc046ffada4 | |
parent | 80aa52d8c5a8a1c26b4114c60c2159c743d236d8 (diff) |
Fix calls to PrintedDeclCXX98Matches. (#86741)
Fix the calls to `PrintedDeclCXX98Matches` to take the lambda function
as the last argument.
-rw-r--r-- | clang/unittests/AST/DeclPrinterTest.cpp | 54 |
1 files changed, 29 insertions, 25 deletions
diff --git a/clang/unittests/AST/DeclPrinterTest.cpp b/clang/unittests/AST/DeclPrinterTest.cpp index 8a29d0544a04..f2b027a25621 100644 --- a/clang/unittests/AST/DeclPrinterTest.cpp +++ b/clang/unittests/AST/DeclPrinterTest.cpp @@ -1387,34 +1387,38 @@ TEST(DeclPrinter, TestTemplateArgumentList16) { } TEST(DeclPrinter, TestCXXRecordDecl17) { - ASSERT_TRUE(PrintedDeclCXX98Matches("template<typename T> struct Z {};" - "struct X {};" - "Z<X> A;", - "A", "Z<X> A")); - (void)[](PrintingPolicy &Policy) { Policy.SuppressTagKeyword = false; }; + ASSERT_TRUE(PrintedDeclCXX98Matches( + "template<typename T> struct Z {};" + "struct X {};" + "Z<X> A;", + "A", "Z<X> A", + [](PrintingPolicy &Policy) { Policy.SuppressTagKeyword = false; })); } TEST(DeclPrinter, TestCXXRecordDecl18) { - ASSERT_TRUE(PrintedDeclCXX98Matches("template<typename T> struct Z {};" - "struct X {};" - "Z<X> A;" - "template <typename T1, int>" - "struct Y{};" - "Y<Z<X>, 2> B;", - "B", "Y<Z<X>, 2> B")); - (void)[](PrintingPolicy &Policy) { Policy.SuppressTagKeyword = false; }; + ASSERT_TRUE(PrintedDeclCXX98Matches( + "template<typename T> struct Z {};" + "struct X {};" + "Z<X> A;" + "template <typename T1, int>" + "struct Y{};" + "Y<Z<X>, 2> B;", + "B", "Y<Z<X>, 2> B", + [](PrintingPolicy &Policy) { Policy.SuppressTagKeyword = false; })); } TEST(DeclPrinter, TestCXXRecordDecl19) { - ASSERT_TRUE(PrintedDeclCXX98Matches("template<typename T> struct Z {};" - "struct X {};" - "Z<X> A;" - "template <typename T1, int>" - "struct Y{};" - "Y<Z<X>, 2> B;", - "B", "Y<Z<X>, 2> B")); - (void)[](PrintingPolicy &Policy) { Policy.SuppressTagKeyword = true; }; + ASSERT_TRUE(PrintedDeclCXX98Matches( + "template<typename T> struct Z {};" + "struct X {};" + "Z<X> A;" + "template <typename T1, int>" + "struct Y{};" + "Y<Z<X>, 2> B;", + "B", "Y<Z<X>, 2> B", + [](PrintingPolicy &Policy) { Policy.SuppressTagKeyword = true; })); } + TEST(DeclPrinter, TestCXXRecordDecl20) { ASSERT_TRUE(PrintedDeclCXX98Matches( "template <typename T, int N> class Inner;" @@ -1431,8 +1435,8 @@ TEST(DeclPrinter, TestCXXRecordDecl20) { "};" "Outer<Inner<int, 10>, 5>::NestedStruct nestedInstance(100);", "nestedInstance", - "Outer<Inner<int, 10>, 5>::NestedStruct nestedInstance(100)")); - (void)[](PrintingPolicy &Policy) { Policy.SuppressTagKeyword = false; }; + "Outer<Inner<int, 10>, 5>::NestedStruct nestedInstance(100)", + [](PrintingPolicy &Policy) { Policy.SuppressTagKeyword = false; })); } TEST(DeclPrinter, TestCXXRecordDecl21) { @@ -1451,8 +1455,8 @@ TEST(DeclPrinter, TestCXXRecordDecl21) { "};" "Outer<Inner<int, 10>, 5>::NestedStruct nestedInstance(100);", "nestedInstance", - "Outer<Inner<int, 10>, 5>::NestedStruct nestedInstance(100)")); - (void)[](PrintingPolicy &Policy) { Policy.SuppressTagKeyword = true; }; + "Outer<Inner<int, 10>, 5>::NestedStruct nestedInstance(100)", + [](PrintingPolicy &Policy) { Policy.SuppressTagKeyword = true; })); } TEST(DeclPrinter, TestFunctionParamUglified) { |