public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Arthur Cohen <cohenarthur@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r14-8075] gccrs: Fix warning with overridden virtual methods
Date: Tue, 16 Jan 2024 18:16:30 +0000 (GMT)	[thread overview]
Message-ID: <20240116181630.2B23A385E001@sourceware.org> (raw)

https://gcc.gnu.org/g:b37170179b5e32e76758c0678182461e834aca44

commit r14-8075-gb37170179b5e32e76758c0678182461e834aca44
Author: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Date:   Mon Oct 23 16:09:54 2023 +0200

    gccrs: Fix warning with overridden virtual methods
    
    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>

Diff:
---
 gcc/rust/ast/rust-pattern.h | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/gcc/rust/ast/rust-pattern.h b/gcc/rust/ast/rust-pattern.h
index 6ee1417a1fd..6a90b536175 100644
--- a/gcc/rust/ast/rust-pattern.h
+++ b/gcc/rust/ast/rust-pattern.h
@@ -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

                 reply	other threads:[~2024-01-16 18:16 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240116181630.2B23A385E001@sourceware.org \
    --to=cohenarthur@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).