-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[clangd] Fix unittests in TargetDeclTest bucket #89630
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-tools-extra @llvm/pr-subscribers-clangd Author: None (zibi2) ChangesThis PR fixes the build errors for one of the
This happens when using a build compiler with #84520. The fix is to include commas to compensate for empty vararg macro arguments in a few instances. Full diff: https://github.com/llvm/llvm-project/pull/89630.diff 1 Files Affected:
diff --git a/clang-tools-extra/clangd/unittests/FindTargetTests.cpp b/clang-tools-extra/clangd/unittests/FindTargetTests.cpp
index 0af6036734ba53..f260deec537e72 100644
--- a/clang-tools-extra/clangd/unittests/FindTargetTests.cpp
+++ b/clang-tools-extra/clangd/unittests/FindTargetTests.cpp
@@ -427,7 +427,7 @@ TEST_F(TargetDeclTest, Types) {
[[auto]] X = S{};
)cpp";
// FIXME: deduced type missing in AST. https://llvm.org/PR42914
- EXPECT_DECLS("AutoTypeLoc");
+ EXPECT_DECLS("AutoTypeLoc",);
Code = R"cpp(
template <typename... E>
@@ -727,13 +727,13 @@ TEST_F(TargetDeclTest, BuiltinTemplates) {
template <class T, int N>
using make_integer_sequence = [[__make_integer_seq]]<integer_sequence, T, N>;
)cpp";
- EXPECT_DECLS("TemplateSpecializationTypeLoc");
+ EXPECT_DECLS("TemplateSpecializationTypeLoc",);
Code = R"cpp(
template <int N, class... Pack>
using type_pack_element = [[__type_pack_element]]<N, Pack...>;
)cpp";
- EXPECT_DECLS("TemplateSpecializationTypeLoc");
+ EXPECT_DECLS("TemplateSpecializationTypeLoc",);
}
TEST_F(TargetDeclTest, MemberOfTemplate) {
@@ -1018,7 +1018,7 @@ TEST_F(TargetDeclTest, DependentTypes) {
typedef typename waldo<N - 1>::type::[[next]] type;
};
)cpp";
- EXPECT_DECLS("DependentNameTypeLoc");
+ EXPECT_DECLS("DependentNameTypeLoc",);
// Similar to above but using mutually recursive templates.
Code = R"cpp(
@@ -1035,7 +1035,7 @@ TEST_F(TargetDeclTest, DependentTypes) {
using type = typename even<N - 1>::type::[[next]];
};
)cpp";
- EXPECT_DECLS("DependentNameTypeLoc");
+ EXPECT_DECLS("DependentNameTypeLoc",);
}
TEST_F(TargetDeclTest, TypedefCascade) {
@@ -1263,14 +1263,14 @@ TEST_F(TargetDeclTest, ObjC) {
+ ([[id]])sharedInstance;
@end
)cpp";
- EXPECT_DECLS("TypedefTypeLoc");
+ EXPECT_DECLS("TypedefTypeLoc",);
Code = R"cpp(
@interface Foo
+ ([[instancetype]])sharedInstance;
@end
)cpp";
- EXPECT_DECLS("TypedefTypeLoc");
+ EXPECT_DECLS("TypedefTypeLoc",);
}
class FindExplicitReferencesTest : public ::testing::Test {
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
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
Side note: I’ve looked into this a bit, and this pattern is used rather sparingly throughout the codebase, but there is precedent for it.
This PR fixes the build errors for one of the
clangd
unit tests bucket similar to the following:This happens when using a build compiler with #84520. The fix is to include commas to compensate for empty vararg macro arguments in a few instances.