Repository navigation
fix(clang-tidy): resolve cppcoreguidelines-special-member-functions findings - #1015
Merged
castler merged 1 commit intoAug 26, 2026
Merged
Conversation
castler
requested review from
LittleHuba,
bemerybmw,
crimson11,
hoe-jo and
limdor
as code owners
August 26, 2026 12:03
…indings Explicitly declares the missing copy/move special member functions (deleted, since none of these classes support meaningful copy/move semantics) so that each class fully follows the Rule of Five instead of relying on implicit generation, per the C++ Core Guidelines' recommendation that if any of destructor/copy/move is user-declared, all five should be declared. Fixes: - sample_sender_receiver.cpp: `TestDestructor` is a scope-guard type that calls `stop_source_.request_stop()` in its destructor; it is only ever used as a named local variable and was never intended to be copied or moved. Deleted copy/move constructor and assignment. - provider.cpp (partial_restart/provider_restart): `CyclicEventSender` already explicitly deleted its copy constructor/assignment (its `std::thread` member isn't copyable) but didn't declare move operations. Since its background thread captures `this`, moving the object would leave the thread referencing a stale instance, so move is deleted too, for the same reason copy already was. - smokeyeyes.cpp: `SharedState` owns a `pthread_barrier_t` that is placed directly into shared memory via placement-new and destroyed in its destructor; the barrier is tied to this object's address, so copying or moving it is not meaningful. Deleted copy/move constructor and assignment. All changes are pure declarations (`= delete`) with no behavioral change to any existing code path, since none of these types were ever copied or moved elsewhere in the codebase. Verified: - Scoped clang-tidy build isolated to cppcoreguidelines-special-member-functions shows 0 findings (down from 3 findings across 3 files). - Full build (`bazel build //score/mw/com/test/common_test_resources/... //score/mw/com/test/partial_restart/... //score/mw/com/test/smokeyeyes/...`) passes. - `bazel test //score/mw/com/test/partial_restart/provider_restart/integration_test:provider_restart_graceful` passes. - `bazel test //:format_test_C++_with_clang-format` passes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
castler
enabled auto-merge
August 26, 2026 13:45
bemerybmw
approved these changes
Aug 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes all
cppcoreguidelines-special-member-functionsclang-tidy findings (3 findings across 3 files).Approach
Explicitly declares the missing copy/move special member functions (deleted, since none of these classes support meaningful copy/move semantics) so each class fully follows the Rule of Five instead of relying on implicit generation, per the C++ Core Guidelines' recommendation that if any of destructor/copy/move is user-declared, all five should be declared.
Fixes
sample_sender_receiver.cpp:TestDestructoris a scope-guard type that callsstop_source_.request_stop()in its destructor; it is only ever used as a named local variable and was never intended to be copied or moved. Deleted copy/move constructor and assignment.provider.cpp(partial_restart/provider_restart):CyclicEventSenderalready explicitly deleted its copy constructor/assignment (itsstd::threadmember isn't copyable) but didn't declare move operations. Since its background thread capturesthis, moving the object would leave the thread referencing a stale instance, so move is deleted too, for the same reason copy already was.smokeyeyes.cpp:SharedStateowns apthread_barrier_tthat is placed directly into shared memory via placement-new and destroyed in its destructor; the barrier is tied to this object's address, so copying or moving it is not meaningful. Deleted copy/move constructor and assignment.All changes are pure declarations (
= delete) with no behavioral change, since none of these types were ever copied or moved elsewhere in the codebase.Verification
cppcoreguidelines-special-member-functionsshows 0 findings (down from 3 across 3 files).bazel build //score/mw/com/test/common_test_resources/... //score/mw/com/test/partial_restart/... //score/mw/com/test/smokeyeyes/...passes.bazel test //score/mw/com/test/partial_restart/provider_restart/integration_test:provider_restart_gracefulpasses.bazel test //:format_test_C++_with_clang-formatpasses.Scope
This PR intentionally contains only
cppcoreguidelines-special-member-functionsfixes, per the project convention of one clang-tidy check per PR (see #995, #999, #1000, #1001, #1003, #1012, #1013, #1014).