aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/ast/rust-ast.h
diff options
context:
space:
mode:
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>2025-04-06 01:43:20 +0200
committerP-E-P <32375388+P-E-P@users.noreply.github.com>2025-04-24 16:53:44 +0000
commit7f52357ff7f1132dbefa6346c9e23606831cb29b (patch)
tree7a16495da89eae07b31718b96553829c438a4829 /gcc/rust/ast/rust-ast.h
parent7c7d476b27c8230aca6698c6c699b3724e20ade6 (diff)
downloadgcc-7f52357ff7f1132dbefa6346c9e23606831cb29b.zip
gcc-7f52357ff7f1132dbefa6346c9e23606831cb29b.tar.gz
gcc-7f52357ff7f1132dbefa6346c9e23606831cb29b.tar.bz2
Add equality operator for identifiers
gcc/rust/ChangeLog: * ast/rust-ast.h: Add equality operator. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Diffstat (limited to 'gcc/rust/ast/rust-ast.h')
-rw-r--r--gcc/rust/ast/rust-ast.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/rust/ast/rust-ast.h b/gcc/rust/ast/rust-ast.h
index 52379fa..5f302bc 100644
--- a/gcc/rust/ast/rust-ast.h
+++ b/gcc/rust/ast/rust-ast.h
@@ -57,6 +57,11 @@ public:
bool empty () const { return ident.empty (); }
+ bool operator== (const Identifier &other) const
+ {
+ return ident == other.ident;
+ }
+
private:
std::string ident;
location_t loc;