Skip to content

Commit 180cf4d

Browse files
authored
[clangd] Fix unittests in TargetDeclTest bucket (llvm#89630)
This PR fixes the build errors for one of the `clangd` unit tests bucket similar to the following: ``` .../clang-tools-extra/clangd/unittests/FindTargetTests.cpp:430:29: error: passing no argument for the '...' parameter of a variadic macro is a C++20 extension [-Werror,-Wc++20-extensions] 430 | EXPECT_DECLS("AutoTypeLoc"); | ^ .../clang-tools-extra/clangd/unittests/FindTargetTests.cpp:98:9: note: macro 'EXPECT_DECLS' defined here 98 | #define EXPECT_DECLS(NodeType, ...) \ | ^ ``` This happens when using a build compiler with llvm#84520. The fix is to include commas to compensate for empty vararg macro arguments in a few instances.
1 parent 772863e commit 180cf4d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

clang-tools-extra/clangd/unittests/FindTargetTests.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ TEST_F(TargetDeclTest, Types) {
427427
[[auto]] X = S{};
428428
)cpp";
429429
// FIXME: deduced type missing in AST. https://llvm.org/PR42914
430-
EXPECT_DECLS("AutoTypeLoc");
430+
EXPECT_DECLS("AutoTypeLoc", );
431431

432432
Code = R"cpp(
433433
template <typename... E>
@@ -727,13 +727,13 @@ TEST_F(TargetDeclTest, BuiltinTemplates) {
727727
template <class T, int N>
728728
using make_integer_sequence = [[__make_integer_seq]]<integer_sequence, T, N>;
729729
)cpp";
730-
EXPECT_DECLS("TemplateSpecializationTypeLoc");
730+
EXPECT_DECLS("TemplateSpecializationTypeLoc", );
731731

732732
Code = R"cpp(
733733
template <int N, class... Pack>
734734
using type_pack_element = [[__type_pack_element]]<N, Pack...>;
735735
)cpp";
736-
EXPECT_DECLS("TemplateSpecializationTypeLoc");
736+
EXPECT_DECLS("TemplateSpecializationTypeLoc", );
737737
}
738738

739739
TEST_F(TargetDeclTest, MemberOfTemplate) {
@@ -1018,7 +1018,7 @@ TEST_F(TargetDeclTest, DependentTypes) {
10181018
typedef typename waldo<N - 1>::type::[[next]] type;
10191019
};
10201020
)cpp";
1021-
EXPECT_DECLS("DependentNameTypeLoc");
1021+
EXPECT_DECLS("DependentNameTypeLoc", );
10221022

10231023
// Similar to above but using mutually recursive templates.
10241024
Code = R"cpp(
@@ -1035,7 +1035,7 @@ TEST_F(TargetDeclTest, DependentTypes) {
10351035
using type = typename even<N - 1>::type::[[next]];
10361036
};
10371037
)cpp";
1038-
EXPECT_DECLS("DependentNameTypeLoc");
1038+
EXPECT_DECLS("DependentNameTypeLoc", );
10391039
}
10401040

10411041
TEST_F(TargetDeclTest, TypedefCascade) {
@@ -1263,14 +1263,14 @@ TEST_F(TargetDeclTest, ObjC) {
12631263
+ ([[id]])sharedInstance;
12641264
@end
12651265
)cpp";
1266-
EXPECT_DECLS("TypedefTypeLoc");
1266+
EXPECT_DECLS("TypedefTypeLoc", );
12671267

12681268
Code = R"cpp(
12691269
@interface Foo
12701270
+ ([[instancetype]])sharedInstance;
12711271
@end
12721272
)cpp";
1273-
EXPECT_DECLS("TypedefTypeLoc");
1273+
EXPECT_DECLS("TypedefTypeLoc", );
12741274
}
12751275

12761276
class FindExplicitReferencesTest : public ::testing::Test {

0 commit comments

Comments
 (0)