From 2e90b44a9fc4c57062d2d59fb0b043547fbbc8f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20Haitz=20Legarreta=20Gorro=C3=B1o?= Date: Thu, 2 May 2024 18:17:58 -0400 Subject: [PATCH] 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 --- .../IO/ImageBase/include/itkImageFileReaderException.h | 7 +++++++ Modules/IO/ImageBase/include/itkImageFileWriter.h | 7 +++++++ Modules/IO/MeshBase/include/itkMeshFileReaderException.h | 7 +++++++ Modules/IO/MeshBase/include/itkMeshFileWriterException.h | 8 ++++++++ 4 files changed, 29 insertions(+) diff --git a/Modules/IO/ImageBase/include/itkImageFileReaderException.h b/Modules/IO/ImageBase/include/itkImageFileReaderException.h index a6e6192e4602..b07a3fd6854a 100644 --- a/Modules/IO/ImageBase/include/itkImageFileReaderException.h +++ b/Modules/IO/ImageBase/include/itkImageFileReaderException.h @@ -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 diff --git a/Modules/IO/ImageBase/include/itkImageFileWriter.h b/Modules/IO/ImageBase/include/itkImageFileWriter.h index 651213435c97..774392656ec9 100644 --- a/Modules/IO/ImageBase/include/itkImageFileWriter.h +++ b/Modules/IO/ImageBase/include/itkImageFileWriter.h @@ -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 diff --git a/Modules/IO/MeshBase/include/itkMeshFileReaderException.h b/Modules/IO/MeshBase/include/itkMeshFileReaderException.h index b8c2dc80b5d1..d5225353fc6d 100644 --- a/Modules/IO/MeshBase/include/itkMeshFileReaderException.h +++ b/Modules/IO/MeshBase/include/itkMeshFileReaderException.h @@ -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 diff --git a/Modules/IO/MeshBase/include/itkMeshFileWriterException.h b/Modules/IO/MeshBase/include/itkMeshFileWriterException.h index 3012219c18ac..b00a1be3d25d 100644 --- a/Modules/IO/MeshBase/include/itkMeshFileWriterException.h +++ b/Modules/IO/MeshBase/include/itkMeshFileWriterException.h @@ -49,6 +49,14 @@ 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