From b305beb4199365a1e8b35f198278be2aaf3efa86 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Fri, 19 Jan 2018 19:05:26 -0800 Subject: [PATCH] Address nitpicking --- src/command_line.cc | 7 ++++--- src/project.cc | 6 ++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/command_line.cc b/src/command_line.cc index 28b1faf2..3c8b023f 100644 --- a/src/command_line.cc +++ b/src/command_line.cc @@ -248,9 +248,10 @@ void LaunchStdinLoop(Config* config, // The message may be partially deserialized. // Emit an error ResponseMessage if |id| is available. if (message) { - Out_Error out; - out.id = message->GetRequestId(); - if (!std::holds_alternative(out.id)) { + lsRequestId id = message->GetRequestId(); + if (!std::holds_alternative(id)) { + Out_Error out; + out.id = id; out.error.code = lsErrorCodes::InvalidParams; out.error.message = std::move(*err); queue->WriteStdout(IpcId::Unknown, out); diff --git a/src/project.cc b/src/project.cc index 6900ada4..50612fe1 100644 --- a/src/project.cc +++ b/src/project.cc @@ -566,6 +566,12 @@ TEST_SUITE("Project") { "-lstdc++", "&/dir/myfile.cc", "-resource-dir=/w/resource_dir/", "-Wno-unknown-warning-option"}); + CheckFlags( + /* raw */ {"clang.exe"}, + /* expected */ + {"clang.exe", "-working-directory", "/dir/", "-xc++", "-std=c++14", + "-resource-dir=/w/resource_dir/", "-Wno-unknown-warning-option"}); + CheckFlags( /* raw */ {"goma", "clang"}, /* expected */