Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

COMP: Fix implicit copy constructor definition deprecation warnings #4639

Conversation

jhlegarreta
Copy link
Member

@jhlegarreta jhlegarreta commented May 2, 2024

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

@github-actions github-actions bot added type:Compiler Compiler support or related warnings area:IO Issues affecting the IO module labels May 2, 2024
@jhlegarreta
Copy link
Member Author

Re #4626 (comment) and #4627 (comment): 199 new warnings appeared today on RogueResearch22. Maybe the compiler does not show more than that many warnings. This addresses a few of them.

@jhlegarreta
Copy link
Member Author

jhlegarreta commented May 2, 2024

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.

Copy link
Member

@thewtex thewtex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💚

@thewtex thewtex added this to the ITK 5.4.0 milestone May 2, 2024
@jhlegarreta jhlegarreta force-pushed the FixImplicitCopyWarningsReadWriteExc branch 3 times, most recently from 2e90b44 to d512c77 Compare May 2, 2024 23:26
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
@jhlegarreta jhlegarreta force-pushed the FixImplicitCopyWarningsReadWriteExc branch from d512c77 to d1ebdfa Compare May 2, 2024 23:27
@jhlegarreta
Copy link
Member Author

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.

@jhlegarreta
Copy link
Member Author

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 #4595 (comment)).

@thewtex thewtex merged commit e5a84a0 into InsightSoftwareConsortium:master May 3, 2024
14 checks passed
@jhlegarreta jhlegarreta deleted the FixImplicitCopyWarningsReadWriteExc branch May 3, 2024 21:05
N-Dekker added a commit to N-Dekker/ITK that referenced this pull request May 8, 2024
Follow-up to pull request InsightSoftwareConsortium#4639
commit d1ebdfa
"COMP: Fix implicit copy constructor definition deprecation warnings"
by Jon Haitz Legarreta Gorroño
N-Dekker added a commit to N-Dekker/ITK that referenced this pull request May 8, 2024
Instead of "manually" defaulting their copy and move member functions.

Follow-up to pull request InsightSoftwareConsortium#4639
commit d1ebdfa
"COMP: Fix implicit copy constructor definition deprecation warnings"
by Jon Haitz Legarreta Gorroño
N-Dekker added a commit to N-Dekker/ITK that referenced this pull request May 13, 2024
Instead of "manually" defaulting their copy and move member functions.

Follow-up to pull request InsightSoftwareConsortium#4639
commit d1ebdfa
"COMP: Fix implicit copy constructor definition deprecation warnings"
by Jon Haitz Legarreta Gorroño
hjmjohnson pushed a commit that referenced this pull request May 15, 2024
Instead of "manually" defaulting their copy and move member functions.

Follow-up to pull request #4639
commit d1ebdfa
"COMP: Fix implicit copy constructor definition deprecation warnings"
by Jon Haitz Legarreta Gorroño
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:IO Issues affecting the IO module type:Compiler Compiler support or related warnings
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants