[gcc r11-3514] analyzer: add some missing FINAL OVERRIDEs

David Malcolm dmalcolm@gcc.gnu.org
Mon Sep 28 23:53:01 GMT 2020


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

commit r11-3514-gc0ed6afef7897f32dc199da9a5430664fcbb61bb
Author: David Malcolm <dmalcolm@redhat.com>
Date:   Mon Sep 28 16:59:15 2020 -0400

    analyzer: add some missing FINAL OVERRIDEs
    
    Spotted by cppcheck.
    
    gcc/analyzer/ChangeLog:
            * region-model.h (binop_svalue::dyn_cast_binop_svalue): Remove
            redundant "virtual".  Add FINAL OVERRIDE.
            (widening_svalue::dyn_cast_widening_svalue): Add FINAL OVERRIDE.
            (compound_svalue::dyn_cast_compound_svalue): Likewise.
            (conjured_svalue::dyn_cast_conjured_svalue): Likewise.

Diff:
---
 gcc/analyzer/region-model.h | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/gcc/analyzer/region-model.h b/gcc/analyzer/region-model.h
index a61aff2c4b3..cfeac8d6951 100644
--- a/gcc/analyzer/region-model.h
+++ b/gcc/analyzer/region-model.h
@@ -806,7 +806,10 @@ public:
   }
 
   enum svalue_kind get_kind () const FINAL OVERRIDE { return SK_BINOP; }
-  virtual const binop_svalue *dyn_cast_binop_svalue () const { return this; }
+  const binop_svalue *dyn_cast_binop_svalue () const FINAL OVERRIDE
+  {
+    return this;
+  }
 
   void dump_to_pp (pretty_printer *pp, bool simple) const FINAL OVERRIDE;
   void accept (visitor *v) const FINAL OVERRIDE;
@@ -1067,7 +1070,10 @@ public:
   }
 
   enum svalue_kind get_kind () const FINAL OVERRIDE { return SK_WIDENING; }
-  const widening_svalue *dyn_cast_widening_svalue () const { return this; }
+  const widening_svalue *dyn_cast_widening_svalue () const FINAL OVERRIDE
+  {
+    return this;
+  }
 
   void dump_to_pp (pretty_printer *pp, bool simple) const FINAL OVERRIDE;
   void accept (visitor *v) const FINAL OVERRIDE;
@@ -1158,7 +1164,10 @@ public:
   compound_svalue (tree type, const binding_map &map);
 
   enum svalue_kind get_kind () const FINAL OVERRIDE { return SK_COMPOUND; }
-  const compound_svalue *dyn_cast_compound_svalue () const { return this; }
+  const compound_svalue *dyn_cast_compound_svalue () const FINAL OVERRIDE
+  {
+    return this;
+  }
 
   void dump_to_pp (pretty_printer *pp, bool simple) const FINAL OVERRIDE;
   void accept (visitor *v) const FINAL OVERRIDE;
@@ -1263,7 +1272,10 @@ public:
   }
 
   enum svalue_kind get_kind () const FINAL OVERRIDE { return SK_CONJURED; }
-  const conjured_svalue *dyn_cast_conjured_svalue () const { return this; }
+  const conjured_svalue *dyn_cast_conjured_svalue () const FINAL OVERRIDE
+  {
+    return this;
+  }
 
   void dump_to_pp (pretty_printer *pp, bool simple) const FINAL OVERRIDE;
   void accept (visitor *v) const FINAL OVERRIDE;


More information about the Gcc-cvs mailing list