Skip to content

Commit 6d749da

Browse files
author
v01dxyz
committed
Fix clangd test
1 parent f125b5e commit 6d749da

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

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

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1577,19 +1577,21 @@ TEST(TypeHints, Aliased) {
15771577
}
15781578

15791579
TEST(TypeHints, CallingConvention) {
1580-
// Check that we don't crash for lambdas without a FunctionTypeLoc
1580+
// Check that we don't crash for lambdas with an annotation
15811581
// https://github.com/clangd/clangd/issues/2223
1582-
std::string Code = R"cpp(
1582+
Annotations Source(R"cpp(
15831583
void test() {
1584-
[]() __cdecl {};
1584+
[]($lambda[[)]]__cdecl {};
15851585
}
1586-
)cpp";
1587-
TestTU TU = TestTU::withCode(Code);
1586+
)cpp");
1587+
TestTU TU = TestTU::withCode(Source.code());
15881588
TU.ExtraArgs.push_back("--target=x86_64-w64-mingw32");
15891589
TU.PredefineMacros = true; // for the __cdecl
15901590
auto AST = TU.build();
15911591

1592-
EXPECT_THAT(hintsOfKind(AST, InlayHintKind::Type), IsEmpty());
1592+
EXPECT_THAT(
1593+
hintsOfKind(AST, InlayHintKind::Type),
1594+
ElementsAre(HintMatcher(ExpectedHint{"-> void", "lambda"}, Source)));
15931595
}
15941596

15951597
TEST(TypeHints, Decltype) {

0 commit comments

Comments
 (0)