]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Add equality operator for identifiers
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Sat, 5 Apr 2025 23:43:20 +0000 (01:43 +0200)
committerP-E-P <32375388+P-E-P@users.noreply.github.com>
Thu, 24 Apr 2025 16:53:44 +0000 (16:53 +0000)
gcc/rust/ChangeLog:

* ast/rust-ast.h: Add equality operator.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
gcc/rust/ast/rust-ast.h

index 52379fae5b2e34c7550dbb378e0f9c3a37a3dc88..5f302bc80d3119f6a92cfdcdded9a7f81ea32ae9 100644 (file)
@@ -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;