diff options
author | Owen Avery <powerboat9.gamer@gmail.com> | 2025-05-13 18:01:33 -0400 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2025-05-19 09:35:05 +0000 |
commit | 2dc57afa16fe10616acb7660fa7d68d2a9666860 (patch) | |
tree | 01856eab784e8b2cc9ff4e8a110319369861a43c | |
parent | 4f772da8df444fbcb84821d4c4c60cf1cc2f5479 (diff) | |
download | gcc-2dc57afa16fe10616acb7660fa7d68d2a9666860.zip gcc-2dc57afa16fe10616acb7660fa7d68d2a9666860.tar.gz gcc-2dc57afa16fe10616acb7660fa7d68d2a9666860.tar.bz2 |
Remove rvalue reference binding
This should be unnecessary, since even C++11 has implicit move.
gcc/rust/ChangeLog:
* parse/rust-parse-impl.h (Parser::parse_expr_stmt): Avoid
reference binding and remove std::move in return statements.
Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
-rw-r--r-- | gcc/rust/parse/rust-parse-impl.h | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-impl.h index bbe75ad..20b17b6 100644 --- a/gcc/rust/parse/rust-parse-impl.h +++ b/gcc/rust/parse/rust-parse-impl.h @@ -7077,10 +7077,7 @@ Parser<ManagedTokenSource>::parse_expr_stmt (AST::AttrVec outer_attrs, if (lexer.peek_token ()->get_id () == EXCLAM) { - // Bind a reference to avoid -Wredundant-move on post-P1825R0 - // compilers. Change to non-reference type and remove the moves - // below once C++20 is required to build gcc. - std::unique_ptr<AST::MacroInvocation> &&invoc + std::unique_ptr<AST::MacroInvocation> invoc = parse_macro_invocation_partial (std::move (path), std::move (outer_attrs)); @@ -7088,7 +7085,7 @@ Parser<ManagedTokenSource>::parse_expr_stmt (AST::AttrVec outer_attrs, { invoc->add_semicolon (); // Macro invocation with semicolon. - return std::move (invoc); + return invoc; } TokenId after_macro = lexer.peek_token ()->get_id (); @@ -7096,14 +7093,14 @@ Parser<ManagedTokenSource>::parse_expr_stmt (AST::AttrVec outer_attrs, if (restrictions.allow_close_after_expr_stmt && (after_macro == RIGHT_PAREN || after_macro == RIGHT_CURLY || after_macro == RIGHT_SQUARE)) - return std::move (invoc); + return invoc; if (invoc->get_invoc_data ().get_delim_tok_tree ().get_delim_type () == AST::CURLY && after_macro != DOT && after_macro != QUESTION_MARK) { rust_debug ("braced macro statement"); - return std::move (invoc); + return invoc; } null_denotation = std::move (invoc); |