aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>2025-07-31 13:19:22 +0200
committerArthur Cohen <arthur.cohen@embecosm.com>2025-08-05 16:37:00 +0200
commite705ad248a22d4a6d7bb54655bf71d5b6404382d (patch)
tree76b63d9569681f72b6ca6b326b645afd371cdbb5 /gcc
parentba7f3c6d3be644b2fe5737ba134dbd8d61f73b2a (diff)
downloadgcc-e705ad248a22d4a6d7bb54655bf71d5b6404382d.zip
gcc-e705ad248a22d4a6d7bb54655bf71d5b6404382d.tar.gz
gcc-e705ad248a22d4a6d7bb54655bf71d5b6404382d.tar.bz2
gccrs: Fix AttrInputMacro operator= overloading.
gcc/rust/ChangeLog: * ast/rust-ast.cc (AttrInputMacro::operator=): Add return type. * ast/rust-expr.h: Likewise. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Diffstat (limited to 'gcc')
-rw-r--r--gcc/rust/ast/rust-ast.cc3
-rw-r--r--gcc/rust/ast/rust-expr.h8
2 files changed, 8 insertions, 3 deletions
diff --git a/gcc/rust/ast/rust-ast.cc b/gcc/rust/ast/rust-ast.cc
index ec1596b..20a41d7 100644
--- a/gcc/rust/ast/rust-ast.cc
+++ b/gcc/rust/ast/rust-ast.cc
@@ -4339,11 +4339,12 @@ AttrInputMacro::AttrInputMacro (const AttrInputMacro &oth)
: macro (oth.macro->clone_macro_invocation_impl ())
{}
-void
+AttrInputMacro &
AttrInputMacro::operator= (const AttrInputMacro &oth)
{
macro = std::unique_ptr<MacroInvocation> (
oth.macro->clone_macro_invocation_impl ());
+ return *this;
}
/* Visitor implementations - these are short but inlining can't happen anyway
diff --git a/gcc/rust/ast/rust-expr.h b/gcc/rust/ast/rust-expr.h
index 4644e8d..c8f7764 100644
--- a/gcc/rust/ast/rust-expr.h
+++ b/gcc/rust/ast/rust-expr.h
@@ -183,9 +183,13 @@ public:
AttrInputMacro (AttrInputMacro &&oth) : macro (std::move (oth.macro)) {}
- void operator= (const AttrInputMacro &oth);
+ AttrInputMacro &operator= (const AttrInputMacro &oth);
- void operator= (AttrInputMacro &&oth) { macro = std::move (oth.macro); }
+ AttrInputMacro &operator= (AttrInputMacro &&oth)
+ {
+ macro = std::move (oth.macro);
+ return *this;
+ }
std::string as_string () const override;