From: Martin Jambor Date: Wed, 25 Jun 2025 15:11:34 +0000 (+0200) Subject: diagnostics: Mark path_label::get_effects as final override X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6af1e7409ce1f763a0fe622e9b08b079d0797989;p=thirdparty%2Fgcc.git 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 * diagnostic-path-output.cc (path_label::get_effects): Mark as final override. * diagnostic-format-html.cc (html_output_format::after_diagnostic): Likewise. --- diff --git a/gcc/diagnostic-format-html.cc b/gcc/diagnostic-format-html.cc index c397c9f088d..1f5c138bcd0 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 bae24bf01a7..4bec3a66267 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; }