ITK
ITK copied to clipboard
COMP: Fix implicit copy constructor definition deprecation warnings
Fix implicit copy constructor definition deprecation warnings in image/mesh file reader exception classes by using explicitly the compiler-provided default implementation (together with the assignment assignment and move semantics).
Fixes:
[CTest: warning matched]
/Users/builder/externalModules/IO/ImageBase/include/itkImageFileReaderException.h:54:3:
warning: definition of implicit copy constructor for 'ImageFileReaderException' is deprecated because it has a user-declared destructor [-Wdeprecated]
~ImageFileReaderException() noexcept override;
^
and
[CTest: warning matched]
/Users/builder/externalModules/IO/ImageBase/include/itkImageFileWriter.h:57:3:
warning: definition of implicit copy constructor for 'ImageFileWriterException' is deprecated because it has a user-declared destructor [-Wdeprecated]
~ImageFileWriterException() noexcept override;
^
and
[CTest: warning matched]
/Users/builder/externalModules/IO/MeshBase/include/itkMeshFileReaderException.h:36:3:
warning: definition of implicit copy constructor for 'MeshFileReaderException' is deprecated because it has a user-declared destructor [-Wdeprecated]
~MeshFileReaderException() noexcept override;
^
and
[CTest: warning matched]
/Users/builder/externalModules/IO/MeshBase/include/itkMeshFileWriterException.h:36:3:
warning: definition of implicit copy constructor for 'MeshFileWriterException' is deprecated because it has a user-declared destructor [-Wdeprecated]
~MeshFileWriterException() noexcept override;
^
Raised for example in: https://open.cdash.org/viewBuildError.php?type=1&buildid=9587875
PR Checklist
- [X] No API changes were made (or the changes have been approved)
- [X] No major design changes were made (or the changes have been approved)
Re https://github.com/InsightSoftwareConsortium/ITK/pull/4626#issuecomment-2083812472 and https://github.com/InsightSoftwareConsortium/ITK/pull/4627#issuecomment-2083813278: 199 new warnings appeared today on RogueResearch22. Maybe the compiler does not show more than that many warnings. This addresses a few of them.
~Format issues are not related to this patch set: https://github.com/InsightSoftwareConsortium/ITK/actions/runs/8931230755/job/24532913042?pr=4639~
Edit: Solved in PR #4640. Thanks Matt.
Tried to use the copy and move disallow macro first, but the compiler was complaining: https://open.cdash.org/viewBuildError.php?buildid=9589284
Rather that trying with the defaults only for the image file reader/writer exceptions only (or the constructor vs assignment only), decided to be consistent across all 4.
Maybe some more investigation on which can be deleted vs defaulted, and developing a macro would be useful in a separate PR. I don't have the bandwidth for that, unfortunately.
Failures on macOS arm64 are unrelated: itkNiftiSpatialTemporalUnitsTest2 is failing. The dashboard shows that this test is failing on a number of sites as well (notified in the original PR https://github.com/InsightSoftwareConsortium/ITK/pull/4595#issuecomment-2092965413).