Skip to content

Commit

Permalink
COMP: Fix implicit copy constructor definition deprecation warnings
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jhlegarreta committed May 2, 2024
1 parent 0ea4ae9 commit d1ebdfa
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Modules/IO/ImageBase/include/itkImageFileReaderException.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ class ITKIOImageBase_EXPORT ImageFileReaderException : public ExceptionObject

/** Has to have empty throw(). */
~ImageFileReaderException() noexcept override;

ImageFileReaderException(const ImageFileReaderException &) = default;
ImageFileReaderException(ImageFileReaderException &&) = default;
ImageFileReaderException &
operator=(const ImageFileReaderException &) = default;
ImageFileReaderException &
operator=(ImageFileReaderException &&) = default;
};
} // namespace itk
#endif // itkImageFileReaderException_h
7 changes: 7 additions & 0 deletions Modules/IO/ImageBase/include/itkImageFileWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ class ITKIOImageBase_EXPORT ImageFileWriterException : public ExceptionObject

/** Has to have empty throw(). */
~ImageFileWriterException() noexcept override;

ImageFileWriterException(const ImageFileWriterException &) = default;
ImageFileWriterException(ImageFileWriterException &&) = default;
ImageFileWriterException &
operator=(const ImageFileWriterException &) = default;
ImageFileWriterException &
operator=(ImageFileWriterException &&) = default;
};

/** \class ImageFileWriter
Expand Down
7 changes: 7 additions & 0 deletions Modules/IO/MeshBase/include/itkMeshFileReaderException.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ class ITKIOMeshBase_EXPORT MeshFileReaderException : public ExceptionObject
unsigned int line,
const char * message = "Error in IO",
const char * loc = "Unknown");

MeshFileReaderException(const MeshFileReaderException &) = default;
MeshFileReaderException(MeshFileReaderException &&) = default;
MeshFileReaderException &
operator=(const MeshFileReaderException &) = default;
MeshFileReaderException &
operator=(MeshFileReaderException &&) = default;
};
} // end namespace itk

Expand Down
7 changes: 7 additions & 0 deletions Modules/IO/MeshBase/include/itkMeshFileWriterException.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ class ITKIOMeshBase_EXPORT MeshFileWriterException : public ExceptionObject
unsigned int line,
const char * message = "Error in IO",
const char * loc = "Unknown");

MeshFileWriterException(const MeshFileWriterException &) = default;
MeshFileWriterException(MeshFileWriterException &&) = default;
MeshFileWriterException &
operator=(const MeshFileWriterException &) = default;
MeshFileWriterException &
operator=(MeshFileWriterException &&) = default;
};
} // end namespace itk

Expand Down

0 comments on commit d1ebdfa

Please sign in to comment.