]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Fix warning with overridden virtual methods
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Mon, 23 Oct 2023 14:09:54 +0000 (16:09 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 18:09:25 +0000 (19:09 +0100)
Overridden virtual methods were not marked as such.

gcc/rust/ChangeLog:

* ast/rust-pattern.h: Add override modifier to overriding methods.

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

index 6ee1417a1fd68154a4c29da29b94a30011381e84..6a90b5361758c79548f1643f1dc5c127eab141bc 100644 (file)
@@ -49,7 +49,7 @@ public:
 
   void accept_vis (ASTVisitor &vis) override;
 
-  NodeId get_node_id () const { return node_id; }
+  NodeId get_node_id () const override { return node_id; }
 
   Literal &get_literal () { return lit; }
 
@@ -147,7 +147,7 @@ public:
   bool get_is_mut () const { return is_mut; }
   bool get_is_ref () const { return is_ref; }
 
-  NodeId get_node_id () const { return node_id; }
+  NodeId get_node_id () const override { return node_id; }
 
 protected:
   /* Use covariance to implement clone function as returning this object rather
@@ -175,7 +175,7 @@ public:
 
   void accept_vis (ASTVisitor &vis) override;
 
-  NodeId get_node_id () const { return node_id; }
+  NodeId get_node_id () const override { return node_id; }
 
 protected:
   /* Use covariance to implement clone function as returning this object rather
@@ -429,7 +429,7 @@ public:
     return upper;
   }
 
-  NodeId get_node_id () const { return node_id; }
+  NodeId get_node_id () const override { return node_id; }
 
 protected:
   /* Use covariance to implement clone function as returning this object rather
@@ -497,7 +497,7 @@ public:
 
   bool get_is_mut () const { return is_mut; }
 
-  NodeId get_node_id () const { return node_id; }
+  NodeId get_node_id () const override { return node_id; }
 
 protected:
   /* Use covariance to implement clone function as returning this object rather
@@ -932,7 +932,7 @@ public:
   PathInExpression &get_path () { return path; }
   const PathInExpression &get_path () const { return path; }
 
-  NodeId get_node_id () const { return node_id; }
+  NodeId get_node_id () const override { return node_id; }
 
 protected:
   /* Use covariance to implement clone function as returning this object rather
@@ -1169,7 +1169,7 @@ public:
   PathInExpression &get_path () { return path; }
   const PathInExpression &get_path () const { return path; }
 
-  NodeId get_node_id () const { return node_id; }
+  NodeId get_node_id () const override { return node_id; }
 
 protected:
   /* Use covariance to implement clone function as returning this object rather
@@ -1409,7 +1409,7 @@ public:
     return items;
   }
 
-  NodeId get_node_id () const { return node_id; }
+  NodeId get_node_id () const override { return node_id; }
 
 protected:
   /* Use covariance to implement clone function as returning this object rather
@@ -1469,7 +1469,7 @@ public:
     return pattern_in_parens;
   }
 
-  NodeId get_node_id () const { return node_id; }
+  NodeId get_node_id () const override { return node_id; }
 
 protected:
   /* Use covariance to implement clone function as returning this object rather
@@ -1533,7 +1533,7 @@ public:
     return items;
   }
 
-  NodeId get_node_id () const { return node_id; }
+  NodeId get_node_id () const override { return node_id; }
 
 protected:
   /* Use covariance to implement clone function as returning this object rather
@@ -1598,7 +1598,7 @@ public:
     return alts;
   }
 
-  NodeId get_node_id () const { return node_id; }
+  NodeId get_node_id () const override { return node_id; }
 
 protected:
   /* Use covariance to implement clone function as returning this object rather