Skip to content

fix(clang-tidy): resolve cppcoreguidelines-special-member-functions findings - #1015

Merged
castler merged 1 commit into
eclipse-score:mainfrom
castler:fix/clang-tidy-special-member-functions
Aug 26, 2026
Merged

castler merged 1 commit into
eclipse-score:mainfrom
castler:fix/clang-tidy-special-member-functions

Conversation

@castler

@castler castler commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes all cppcoreguidelines-special-member-functions clang-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: 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, since none of these types were ever copied or moved elsewhere in the codebase.

Verification

  • Scoped clang-tidy build isolated to cppcoreguidelines-special-member-functions shows 0 findings (down from 3 across 3 files).
  • Full 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.

Scope

This PR intentionally contains only cppcoreguidelines-special-member-functions fixes, per the project convention of one clang-tidy check per PR (see #995, #999, #1000, #1001, #1003, #1012, #1013, #1014).

…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
castler enabled auto-merge August 26, 2026 13:45
@castler
castler added this pull request to the merge queue Aug 26, 2026
Merged via the queue into eclipse-score:main with commit b1cce3a Aug 26, 2026
18 checks passed
@castler
castler deleted the fix/clang-tidy-special-member-functions branch August 26, 2026 14:04
@github-project-automation github-project-automation Bot moved this from Backlog to Done in COM - Communication FT Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants