]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
diagnostics: Mark path_label::get_effects as final override
authorMartin Jambor <mjambor@suse.cz>
Wed, 25 Jun 2025 15:11:34 +0000 (17:11 +0200)
committerMartin Jambor <jamborm@gcc.gnu.org>
Wed, 25 Jun 2025 15:11:45 +0000 (17:11 +0200)
When compiling diagnostic-path-output.cc with clang, it warns that
path_label::get_effects should be marked as override.  That looks like
a good idea and from a brief look I also believe it should be marked
as final (the other override in the class is marked as both), so this
patch does that.

Likewise for html_output_format::after_diagnostic in
diagnostic-format-html.cc which also already has quite a few member
functions marked as final override.

gcc/ChangeLog:

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

* diagnostic-path-output.cc (path_label::get_effects): Mark as
final override.
* diagnostic-format-html.cc
(html_output_format::after_diagnostic): Likewise.

gcc/diagnostic-format-html.cc
gcc/diagnostic-path-output.cc

index c397c9f088d027d0a9591d8059bb9e48f81f958a..1f5c138bcd08558e6d4c0bce48df54bdf6a636eb 100644 (file)
@@ -1311,7 +1311,7 @@ public:
   {
     m_builder.emit_diagram (diagram);
   }
-  void after_diagnostic (const diagnostic_info &)
+  void after_diagnostic (const diagnostic_info &) final override
   {
     /* No-op, but perhaps could show paths here.  */
   }
index bae24bf01a707d70276a84789529cccf8ed8fc52..4bec3a66267f62dd001eb2d40ba6808441633bd5 100644 (file)
@@ -135,7 +135,7 @@ class path_label : public range_label
     return result;
   }
 
-  const label_effects *get_effects (unsigned /*range_idx*/) const
+  const label_effects *get_effects (unsigned /*range_idx*/) const final override
   {
     return &m_effects;
   }