aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>2025-08-01 16:43:18 +0200
committerArthur Cohen <arthur.cohen@embecosm.com>2025-08-05 16:37:02 +0200
commit73a77277d1aeaaaf422b6583e7dc75ac3013bc62 (patch)
tree4df05e8da56d05bcc8382ef810a1acfde67db6fc /gcc
parenta22c11304c40ed8895d00555fe91a33291ba7c67 (diff)
downloadgcc-73a77277d1aeaaaf422b6583e7dc75ac3013bc62.zip
gcc-73a77277d1aeaaaf422b6583e7dc75ac3013bc62.tar.gz
gcc-73a77277d1aeaaaf422b6583e7dc75ac3013bc62.tar.bz2
gccrs: Retrieve token stream before vector move
gcc/rust/ChangeLog: * expand/rust-macro-builtins-helpers.cc: Remove use after move. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Diffstat (limited to 'gcc')
-rw-r--r--gcc/rust/expand/rust-macro-builtins-helpers.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/rust/expand/rust-macro-builtins-helpers.cc b/gcc/rust/expand/rust-macro-builtins-helpers.cc
index 864379a..19af5df 100644
--- a/gcc/rust/expand/rust-macro-builtins-helpers.cc
+++ b/gcc/rust/expand/rust-macro-builtins-helpers.cc
@@ -68,6 +68,7 @@ make_eager_builtin_invocation (
{
auto path_str = make_macro_path_str (kind);
+ auto token_stream = arguments.to_token_stream ();
std::unique_ptr<AST::Expr> node = AST::MacroInvocation::Builtin (
kind,
AST::MacroInvocData (AST::SimplePath (
@@ -76,7 +77,7 @@ make_eager_builtin_invocation (
{}, locus, std::move (pending_invocations));
return AST::Fragment ({AST::SingleASTNode (std::move (node))},
- arguments.to_token_stream ());
+ std::move (token_stream));
}
/* Match the end token of a macro given the start delimiter of the macro */