diff --git a/src/message_handler.cc b/src/message_handler.cc index 321d1b68..ff68130b 100644 --- a/src/message_handler.cc +++ b/src/message_handler.cc @@ -121,8 +121,8 @@ void ReplyOnce::replyLocationLink(std::vector &result) { if (g_config->client.linkSupport) { (*this)(result); } else { - std::vector result1{std::make_move_iterator(result.begin()), - std::make_move_iterator(result.end())}; + std::vector result1(std::make_move_iterator(result.begin()), + std::make_move_iterator(result.end())); (*this)(result1); } } diff --git a/src/pipeline.cc b/src/pipeline.cc index 45fc1286..a8ebaa7c 100644 --- a/src/pipeline.cc +++ b/src/pipeline.cc @@ -616,7 +616,7 @@ void mainLoop() { SemaManager manager( &project, &wfiles, - [&](const std::string &path, std::vector diagnostics) { + [](const std::string &path, std::vector diagnostics) { PublishDiagnosticParam params; params.uri = DocumentUri::fromPath(path); params.diagnostics = std::move(diagnostics); @@ -718,7 +718,7 @@ void standalone(const std::string &root) { VFS vfs; SemaManager manager( nullptr, nullptr, - [&](const std::string &, const std::vector &) {}, + [](const std::string &, const std::vector &) {}, [](const RequestId &id) {}); IncludeComplete complete(&project); diff --git a/src/sema_manager.cc b/src/sema_manager.cc index a6097e82..2de553cc 100644 --- a/src/sema_manager.cc +++ b/src/sema_manager.cc @@ -231,7 +231,7 @@ class StoreDiags : public DiagnosticConsumer { } public: - StoreDiags(std::string path) : path{std::move(path)} {} + StoreDiags(std::string path) : path(std::move(path)) {} std::vector take() { return std::move(output); } bool isConcerned(const SourceManager &sm, SourceLocation l) { FileID fid = sm.getFileID(l); diff --git a/src/serializer.cc b/src/serializer.cc index c050dd22..50ce8387 100644 --- a/src/serializer.cc +++ b/src/serializer.cc @@ -35,7 +35,7 @@ bool gTestOutputMode = false; namespace ccls { -void JsonReader::iterArray(const llvm::function_ref fn) { +void JsonReader::iterArray(llvm::function_ref fn) { if (!m->IsArray()) throw std::invalid_argument("array"); // Use "0" to indicate any element for now. @@ -48,7 +48,7 @@ void JsonReader::iterArray(const llvm::function_ref fn) { } path_.pop_back(); } -void JsonReader::member(const char *name, const llvm::function_ref fn) { +void JsonReader::member(const char *name, llvm::function_ref fn) { path_.push_back(name); auto it = m->FindMember(name); if (it != m->MemberEnd()) { diff --git a/src/serializer.hh b/src/serializer.hh index b56ef7f2..49bbb615 100644 --- a/src/serializer.hh +++ b/src/serializer.hh @@ -49,8 +49,8 @@ struct JsonReader { JsonReader(rapidjson::Value *m) : m(m) {} void startObject() {} void endObject() {} - void iterArray(const llvm::function_ref fn); - void member(const char *name, const llvm::function_ref fn); + void iterArray(llvm::function_ref fn); + void member(const char *name, llvm::function_ref fn); bool isNull(); std::string getString(); std::string getPath() const;