Skip to content

Commit

Permalink
[test][clangd] Fix use-after-return after 72142fb
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalybuka committed Sep 11, 2022
1 parent 4891ef2 commit c3c930d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions clang-tools-extra/clangd/unittests/TUSchedulerTests.cpp
Expand Up @@ -1227,14 +1227,14 @@ TEST_F(TUSchedulerTests, IncluderCache) {
auto GetFlags = [&](PathRef Header) {
S.update(Header, getInputs(Header, ";"), WantDiagnostics::Yes);
EXPECT_TRUE(S.blockUntilIdle(timeoutSeconds(10)));
tooling::CompileCommand Cmd;
auto Cmd = std::make_shared<tooling::CompileCommand>();
S.runWithPreamble("GetFlags", Header, TUScheduler::StaleOrAbsent,
[&](llvm::Expected<InputsAndPreamble> Inputs) {
[Cmd](llvm::Expected<InputsAndPreamble> Inputs) {
ASSERT_FALSE(!Inputs) << Inputs.takeError();
Cmd = std::move(Inputs->Command);
*Cmd = std::move(Inputs->Command);
});
EXPECT_TRUE(S.blockUntilIdle(timeoutSeconds(10)));
return Cmd.CommandLine;
return Cmd->CommandLine;
};

for (const auto &Path : {NoCmd, Unreliable, OK, NotIncluded})
Expand Down

0 comments on commit c3c930d

Please sign in to comment.