[clangd] Fix another TSAN issue

llvm-svn: 372128
This commit is contained in:
Benjamin Kramer 2019-09-17 14:56:11 +00:00
parent 167b302075
commit 957a6c6bed
1 changed files with 3 additions and 1 deletions

View File

@ -769,12 +769,14 @@ TEST_F(TUSchedulerTests, CommandLineWarnings) {
// We should not see warnings from command-line parsing.
CDB.ExtraClangFlags = {"-Wsome-unknown-warning"};
// (!) 'Ready' must live longer than TUScheduler.
Notification Ready;
TUScheduler S(CDB, /*AsyncThreadsCount=*/getDefaultAsyncThreadsCount(),
/*StorePreambleInMemory=*/true, /*ASTCallbacks=*/captureDiags(),
/*UpdateDebounce=*/std::chrono::steady_clock::duration::zero(),
ASTRetentionPolicy());
Notification Ready;
std::vector<Diag> Diagnostics;
updateWithDiags(S, testPath("foo.cpp"), "void test() {}",
WantDiagnostics::Yes, [&](std::vector<Diag> D) {