]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-ssa-propagate.h: Mark two functions as override
authorMartin Jambor <mjambor@suse.cz>
Wed, 25 Jun 2025 15:02:10 +0000 (17:02 +0200)
committerMartin Jambor <jamborm@gcc.gnu.org>
Wed, 25 Jun 2025 15:02:22 +0000 (17:02 +0200)
When tree-ssa-propagate.h is compiled with clang, it complains that
member functions functions value_of_expr and range_of_expr of class
substitute_and_fold_engine are not marked as override even though they
do override virtual functions of the ancestor class.  This patch
merely adds the keyword to silence the warning and for consistency's
sake.

I did not make this part of the previous patch because I wanted to
point out that the first case is quite unusual, a virtual function
with a functional body (range_query::value_of_expr) is being
overridden with a pure virtual function.  I assume it was a conscious
decision but adding the override keyword seems even more important
then.

gcc/ChangeLog:

2025-06-24  Martin Jambor  <mjambor@suse.cz>

* tree-ssa-propagate.h (class substitute_and_fold_engine): Mark
member functions value_of_expr and range_of_expr as override.

gcc/tree-ssa-propagate.h

index 8429e38f40e4568b47b63d3c7aaab2fa8eafd4ac..200fc7320796f47d975ec4c035422b4e4fbf1e44 100644 (file)
@@ -102,10 +102,10 @@ class substitute_and_fold_engine : public range_query
   substitute_and_fold_engine (bool fold_all_stmts = false)
     : fold_all_stmts (fold_all_stmts) { }
 
-  virtual tree value_of_expr (tree expr, gimple * = NULL) = 0;
+  virtual tree value_of_expr (tree expr, gimple * = NULL) override = 0;
   virtual tree value_on_edge (edge, tree expr) override;
   virtual tree value_of_stmt (gimple *, tree name = NULL) override;
-  virtual bool range_of_expr (vrange &r, tree expr, gimple * = NULL);
+  virtual bool range_of_expr (vrange &r, tree expr, gimple * = NULL) override;
 
   virtual ~substitute_and_fold_engine (void) { }
   virtual bool fold_stmt (gimple_stmt_iterator *) { return false; }