https://gcc.gnu.org/g:6af1e7409ce1f763a0fe622e9b08b079d0797989
commit r16-1684-g6af1e7409ce1f763a0fe622e9b08b079d0797989 Author: Martin Jambor <mjam...@suse.cz> Date: Wed Jun 25 17:11:34 2025 +0200 diagnostics: Mark path_label::get_effects as final override 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 <mjam...@suse.cz> * diagnostic-path-output.cc (path_label::get_effects): Mark as final override. * diagnostic-format-html.cc (html_output_format::after_diagnostic): Likewise. Diff: --- gcc/diagnostic-format-html.cc | 2 +- gcc/diagnostic-path-output.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/diagnostic-format-html.cc b/gcc/diagnostic-format-html.cc index c397c9f088d0..1f5c138bcd08 100644 --- a/gcc/diagnostic-format-html.cc +++ b/gcc/diagnostic-format-html.cc @@ -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. */ } diff --git a/gcc/diagnostic-path-output.cc b/gcc/diagnostic-path-output.cc index bae24bf01a70..4bec3a66267f 100644 --- a/gcc/diagnostic-path-output.cc +++ b/gcc/diagnostic-path-output.cc @@ -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; }