Skip to content

Commit

Permalink
Fix warning with overridden virtual methods
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
P-E-P committed Oct 24, 2023
1 parent eb393ac commit 9a8b3ea
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions gcc/rust/ast/rust-pattern.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class LiteralPattern : public Pattern

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; }

Expand Down Expand Up @@ -147,7 +147,7 @@ class IdentifierPattern : public Pattern
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
Expand Down Expand Up @@ -175,7 +175,7 @@ class WildcardPattern : public Pattern

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
Expand Down Expand Up @@ -429,7 +429,7 @@ class RangePattern : public Pattern
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
Expand Down Expand Up @@ -497,7 +497,7 @@ class ReferencePattern : public Pattern

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
Expand Down Expand Up @@ -932,7 +932,7 @@ class StructPattern : public Pattern
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
Expand Down Expand Up @@ -1169,7 +1169,7 @@ class TupleStructPattern : public Pattern
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
Expand Down Expand Up @@ -1409,7 +1409,7 @@ class TuplePattern : public Pattern
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
Expand Down Expand Up @@ -1469,7 +1469,7 @@ class GroupedPattern : public Pattern
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
Expand Down Expand Up @@ -1533,7 +1533,7 @@ class SlicePattern : public Pattern
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
Expand Down Expand Up @@ -1598,7 +1598,7 @@ class AltPattern : public Pattern
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
Expand Down

0 comments on commit 9a8b3ea

Please sign in to comment.