From a20721a27808ddfb523bad32ce265fbbbb58639e Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Thu, 27 Aug 2020 22:28:17 +0200 Subject: [PATCH] Address some warnings from clangd --- src/ast.cpp | 6 +++--- src/reader.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ast.cpp b/src/ast.cpp index ee881dd72..39fe5d2ff 100644 --- a/src/ast.cpp +++ b/src/ast.cpp @@ -125,7 +125,7 @@ class token_stream_t { if (count_ == 0) { return next_from_tok(); } - parse_token_t result = std::move(lookahead_[start_]); + parse_token_t result = lookahead_[start_]; start_ = mask(start_ + 1); count_ -= 1; return result; @@ -471,7 +471,7 @@ class ast_t::populator_t { /// \return whether the status is unwinding. /// This is more efficient than checking the status directly. - bool is_unwinding() { return unwinding_; } + bool is_unwinding() const { return unwinding_; } /// \return whether any leaf nodes we visit should be marked as unsourced. bool unsource_leaves() { @@ -933,7 +933,7 @@ class ast_t::populator_t { // We're going to heap-allocate our array. using contents_ptr_t = typename list_t::contents_ptr_t; - contents_ptr_t *array = new contents_ptr_t[contents.size()]; + auto *array = new contents_ptr_t[contents.size()]; std::move(contents.begin(), contents.end(), array); list.length = static_cast(contents.size()); diff --git a/src/reader.cpp b/src/reader.cpp index be1e6eab7..da4e3587f 100644 --- a/src/reader.cpp +++ b/src/reader.cpp @@ -1043,7 +1043,7 @@ maybe_t reader_expand_abbreviation_in_command(const wcstring &cmdline, s // Look for plain statements where the cursor is at the end of the command. const ast::string_t *matching_cmd_node = nullptr; for (const node_t &n : ast) { - const decorated_statement_t *stmt = n.try_as(); + const auto *stmt = n.try_as(); if (!stmt) continue; // Skip if we have a decoration.