COMP: Suppress LabelGeometryImageFilter self-deprecation warnings#6446
Open
hjmjohnson wants to merge 1 commit into
Open
COMP: Suppress LabelGeometryImageFilter self-deprecation warnings#6446hjmjohnson wants to merge 1 commit into
hjmjohnson wants to merge 1 commit into
Conversation
itk::LabelGeometryImageFilter is marked [[deprecated]]. Its own out-of-line method definitions in the .hxx reference the class name, emitting -Wdeprecated-declarations for every translation unit that includes the header (e.g. ITKReviewHeaderTest1) and for the unit test that exercises it. Guard the .hxx implementation and the test's direct instantiation with a -Wdeprecated-declarations push/pop, matching the idiom used in the Vnl*FFTImageFilter headers.
Contributor
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.
itk::LabelGeometryImageFilteris marked[[deprecated]], but its own out-of-line method definitions in the.hxxreference the class name, so every translation unit that includes the header (e.g.ITKReviewHeaderTest1) and the unit test that exercises it emit-Wdeprecated-declarations. This guards the implementation and the test's direct instantiation so a deprecated class no longer warns about its own internal use.Warning counts (GCC 14)
itkLabelGeometryImageFilterTest.cxxITKReviewHeaderTest1.cxxApproach
Wrap the self-referential regions in a
-Wdeprecated-declarationspush/ignore/pop, matching the existing idiom in theVnl*FFTImageFilterheaders:itkLabelGeometryImageFilter.hxx— guard theitknamespace body (out-of-line definitions self-reference the class).itkLabelGeometryImageFilterTest.cxx— guard the single directusing LabelGeometryImageFilter<...>instantiation.No behavior change.
ctest -R LabelGeometrypasses (4/4);pre-commit run --all-filesclean.