diff --git a/clang-tools-extra/clangd/xpc/XPCTransport.cpp b/clang-tools-extra/clangd/xpc/XPCTransport.cpp index dd4bb7028da965..02c1b083701e93 100644 --- a/clang-tools-extra/clangd/xpc/XPCTransport.cpp +++ b/clang-tools-extra/clangd/xpc/XPCTransport.cpp @@ -37,7 +37,8 @@ json::Object encodeError(Error E) { } Error decodeError(const json::Object &O) { - std::string Msg = O.getString("message").getValueOr("Unspecified error"); + std::string Msg = + std::string(O.getString("message").getValueOr("Unspecified error")); if (auto Code = O.getInteger("code")) return make_error(std::move(Msg), ErrorCode(*Code)); return make_error(std::move(Msg), inconvertibleErrorCode());