build: mark missing overrides and drop unused lambda captures (1,156 clang warnings) (#15334)

* chore: mark every declaration that overrides a base virtual

clang-cl reports 42 member functions across 28 files that override a
base virtual without being marked `override`, inside classes that
already mark their other overrides. That is every occurrence of
-Winconsistent-missing-override in the tree, so the category drops to
zero and -Werror=inconsistent-missing-override becomes available as a
guard against it coming back.

Behaviour is unchanged. Each keyword goes only where clang had already
resolved the declaration to a base virtual, so it records what the
compiler already worked out and cannot affect overload resolution or
dispatch. If any of these signatures had not really overridden a base
method, the build would have failed rather than warned.

Where a declaration already carried `virtual` it is left alone and the
keyword appended, matching the surrounding declarations. Plain
`override` is used rather than the wxWidgets `wxOVERRIDE` macro, which
wx/defs.h defines as `override` beneath a comment marking it obsolete,
and which the rest of src/slic3r already avoids by 1742 occurrences to
113.

A full clang-cl build takes -Winconsistent-missing-override from 1,146
warning lines to 0. Those 42 declarations produce that many lines
because a header is re-diagnosed in every translation unit that
includes it. CalibrationWizardStartPage.hpp alone accounts for 336 of
them from 4 declarations.

* chore: drop unused lambda captures in GUI/Widgets

clang-cl reports 10 lambda captures in src/slic3r/GUI/Widgets that are
never read. Removing them changes nothing at runtime.

Every capture removed is `this` or a raw pointer. clang does not report
a capture whose type has a non-trivial destructor, since such a capture
can be held purely for its effect on an object's lifetime, so nothing
that owns or extends a lifetime is touched. The std::weak_ptr captured
beside the removed `this` in MultiNozzleSync.cpp stays.

This clears the category in GUI/Widgets only. A full clang-cl build
takes -Wunused-lambda-capture from 312 warning lines to 302, leaving
235 sites in other directories for a follow-up.
This commit is contained in:
Kris Austin
2026-08-25 08:18:48 -03:00
committed by GitHub
parent 524fd5e9c0
commit 56f9edc572
32 changed files with 52 additions and 52 deletions
+2 -2
View File
@@ -21,14 +21,14 @@ public:
~CrealityPrint() override = default;
const char* get_name() const override;
virtual bool can_test() const { return true; };
virtual bool can_test() const override { return true; };
std::string get_host() const override;
bool has_auto_discovery() const override { return true; }
wxString get_test_ok_msg() const override;
wxString get_test_failed_msg(wxString& msg) const override;
virtual bool test(wxString& curl_msg) const override;
PrintHostPostUploadActions get_post_upload_actions() const;
PrintHostPostUploadActions get_post_upload_actions() const override;
bool upload(PrintHostUpload upload_data, ProgressFn prorgess_fn, ErrorFn error_fn, InfoFn info_fn) const override;
bool supports_multi_color_print() const;
std::string query_boxes_info() const;
+3 -3
View File
@@ -32,10 +32,10 @@ public:
PrintHostPostUploadActions get_post_upload_actions() const override;
protected:
#ifdef WIN32
virtual bool upload_inner_with_resolved_ip(PrintHostUpload upload_data, ProgressFn prorgess_fn, ErrorFn error_fn, InfoFn info_fn, const boost::asio::ip::address& resolved_addr) const;
virtual bool upload_inner_with_resolved_ip(PrintHostUpload upload_data, ProgressFn prorgess_fn, ErrorFn error_fn, InfoFn info_fn, const boost::asio::ip::address& resolved_addr) const override;
#endif
virtual bool validate_version_text(const boost::optional<std::string> &version_text) const;
virtual bool upload_inner_with_host(PrintHostUpload upload_data, ProgressFn prorgess_fn, ErrorFn error_fn, InfoFn info_fn) const;
virtual bool validate_version_text(const boost::optional<std::string> &version_text) const override;
virtual bool upload_inner_with_host(PrintHostUpload upload_data, ProgressFn prorgess_fn, ErrorFn error_fn, InfoFn info_fn) const override;
#ifdef WIN32
virtual bool test_with_resolved_ip(wxString& curl_msg) const override;
+2 -2
View File
@@ -20,7 +20,7 @@ public:
~Obico() override = default;
const char* get_name() const override;
virtual bool can_test() const { return true; };
virtual bool can_test() const override { return true; };
bool has_auto_discovery() const override { return false; }
bool is_cloud() const override { return true; }
bool get_login_url(wxString& auth_url) const override;
@@ -30,7 +30,7 @@ public:
wxString get_test_failed_msg(wxString& msg) const override;
virtual bool test(wxString& curl_msg) const override;
bool get_printers(wxArrayString& printers) const override;
PrintHostPostUploadActions get_post_upload_actions() const;
PrintHostPostUploadActions get_post_upload_actions() const override;
bool upload(PrintHostUpload upload_data, ProgressFn prorgess_fn, ErrorFn error_fn, InfoFn info_fn) const override;
protected: