Skip to content

Commit

Permalink
ast: Add explicit default copy constructor
Browse files Browse the repository at this point in the history
Add explicit default copy/move constructor to identifiers.

gcc/rust/ChangeLog:

	* ast/rust-ast.h: Add default constructors.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
  • Loading branch information
P-E-P authored and CohenArthur committed Jun 29, 2023
1 parent d5723cc commit 09512e6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions gcc/rust/ast/rust-ast.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ class Identifier
: ident (ident), node_id (Analysis::Mappings::get ()->get_next_node_id ())
{}

Identifier (const Identifier &) = default;
Identifier (Identifier &&) = default;
Identifier &operator= (const Identifier &) = default;
Identifier &operator= (Identifier &&) = default;

NodeId get_node_id () const { return node_id; }
const std::string &as_string () const { return ident; }

Expand Down

0 comments on commit 09512e6

Please sign in to comment.