Address nitpicking

This commit is contained in:
Fangrui Song 2018-01-19 19:05:26 -08:00
parent 8f41aa72de
commit b305beb419
2 changed files with 10 additions and 3 deletions

View File

@ -248,9 +248,10 @@ void LaunchStdinLoop(Config* config,
// The message may be partially deserialized. // The message may be partially deserialized.
// Emit an error ResponseMessage if |id| is available. // Emit an error ResponseMessage if |id| is available.
if (message) { if (message) {
Out_Error out; lsRequestId id = message->GetRequestId();
out.id = message->GetRequestId(); if (!std::holds_alternative<std::monostate>(id)) {
if (!std::holds_alternative<std::monostate>(out.id)) { Out_Error out;
out.id = id;
out.error.code = lsErrorCodes::InvalidParams; out.error.code = lsErrorCodes::InvalidParams;
out.error.message = std::move(*err); out.error.message = std::move(*err);
queue->WriteStdout(IpcId::Unknown, out); queue->WriteStdout(IpcId::Unknown, out);

View File

@ -566,6 +566,12 @@ TEST_SUITE("Project") {
"-lstdc++", "&/dir/myfile.cc", "-resource-dir=/w/resource_dir/", "-lstdc++", "&/dir/myfile.cc", "-resource-dir=/w/resource_dir/",
"-Wno-unknown-warning-option"}); "-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( CheckFlags(
/* raw */ {"goma", "clang"}, /* raw */ {"goma", "clang"},
/* expected */ /* expected */