COMP: Apply rule of zero to LogicOpBase#6664
Merged
hjmjohnson merged 1 commit intoJul 20, 2026
Merged
Conversation
The defaulted destructor deprecated the implicit copy members and suppressed the move members outright. It is non-virtual and both members are trivially copyable, so removing it restores all four and silences -Wdeprecated-copy-with-dtor. Follows InsightSoftwareConsortium#6592.
hjmjohnson
force-pushed
the
fix-logicops-deprecated-copy
branch
from
July 19, 2026 13:25
db3dd3c to
86d62a7
Compare
hjmjohnson
marked this pull request as ready for review
July 19, 2026 13:30
Contributor
|
| Filename | Overview |
|---|---|
| Modules/Filtering/ImageIntensity/include/itkLogicOpsFunctors.h | Removes the explicitly defaulted non-virtual LogicOpBase destructor so copy and move special members are implicitly generated again; no functional issues found. |
Reviews (1): Last reviewed commit: "COMP: Apply rule of zero to LogicOpBase" | Re-trigger Greptile
dzenanz
approved these changes
Jul 20, 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.
Remove the defaulted destructor from
LogicOpBaseso the implicit copy and move members come back, silencing the last-Wdeprecated-copy-with-dtorwarning on the nightly dashboards.Follows #6592, which applied the same rule-of-zero treatment to
MaskInput,SimilarPixelsFunctor, andSimilarVectorsFunctor. #6538 covers the two remaining files, where the classes havevirtualdestructors andITK_DEFAULT_COPY_AND_MOVEremains the right fix.The warning
LogicOpBasedeclared~LogicOpBase() = default;and nothing else, so the implicit copy members were deprecated:One declaration accounted for the whole functor family —
Equal,NotEqual,Greater,GreaterEqual,Less,LessEqual, andNOTall derive fromLogicOpBase.The destructor was non-virtual, nothing deletes through a
LogicOpBase*, and both members are trivially copyable, so removing it is behavior-preserving. It had also been suppressing move construction and assignment outright, so removing it restores all four special members rather than the two that warned.Distribution of the flag across the nightly builds, for reference:
itkDefaultVectorPixelAccessor.hitkPriorityQueueContainer.hitkLogicOpsFunctors.hVerification
Compiled a probe exercising copy-construct, copy-assign, move-construct, and move-assign on
Equal<float, float, unsigned char>andNOT, against the real include set of a configured build tree:-Wdeprecated-copy-with-dtor-Wdeprecated-copy-dtorThe two "before" diagnostics are exactly the copy-constructor and copy-assignment warnings quoted above. g++ reports nothing either way — this is a clang-only diagnostic, consistent with it surfacing on the AppleClang nightlies. The move lines in the probe compile after the change, confirming the moves the destructor had suppressed are back.
Full rebuild (Linux x86_64, GCC 13.3.0, Release): 4148 of 4148 edges built, no errors, and
itkLogicOpsFunctors.happears zero times in the build log, so nothing downstream is disturbed.pre-commit run --all-filespasses.