-
Notifications
You must be signed in to change notification settings - Fork 14.3k
Fix calls to PrintedDeclCXX98Matches. #86741
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@llvm/pr-subscribers-clang Author: Zahira Ammarguellat (zahiraam) Changeshttps://lab.llvm.org/buildbot/#/builders/36/builds/43998/steps/12/logs/stdio Full diff: https://github.com/llvm/llvm-project/pull/86741.diff 1 Files Affected:
diff --git a/clang/unittests/AST/DeclPrinterTest.cpp b/clang/unittests/AST/DeclPrinterTest.cpp
index 07fa02bd96e25d..f2b027a25621ce 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"));
- [](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"));
- [](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"));
- [](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)"));
- [](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)"));
- [](PrintingPolicy &Policy) { Policy.SuppressTagKeyword = true; };
+ "Outer<Inner<int, 10>, 5>::NestedStruct nestedInstance(100)",
+ [](PrintingPolicy &Policy) { Policy.SuppressTagKeyword = true; }));
}
TEST(DeclPrinter, TestFunctionParamUglified) {
|
Tagging @amy-kwan and @kazutakahirata . Hopefully this will fix the issue. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks!
Would you mind merging this PR into the LLVM source tree if nothing is blocking you? If something is blocking you, I am happy to revert your original patch on your behalf (along with the |
I thought the issue was fixed with the (void) addition! If not, I will merge this PR immediately. |
Sorry, I misunderstood. The Meanwhile, I am guessing that you have added lambda functions to control the behavior of |
OK. I have edited the description since this is not for fixing the build as much as fixing the call |
Now I wonder if the fix should be with the (void) or without. Have you tried it locally to see if you get the same build error? |
Yes, I just tried your patch and confirmed that the unit test passes without a problem. No, you shouldn't keep |
Perfect! As soon as the testing completes I will merge it in. Thanks. |
Fix the calls to
PrintedDeclCXX98Matches
to take the lambda function as the last argument.