]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Fix AttrInputMacro operator= overloading.
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Thu, 31 Jul 2025 11:19:22 +0000 (13:19 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 5 Aug 2025 14:37:00 +0000 (16:37 +0200)
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>
gcc/rust/ast/rust-ast.cc
gcc/rust/ast/rust-expr.h

index ec1596bfb978cbe97a7156ed80c9d11ce44b8d54..20a41d72cdfca1c78dfe4e92ab3351163f4f86a6 100644 (file)
@@ -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
index 4644e8dcec77a554d19a00644878f02a12676359..c8f776481b581a4f59b03142785603c29842eab3 100644 (file)
@@ -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;