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

gcc9 multiple -Wdeprecated-copy warnings #1302

Open
phcerdan opened this issue Oct 7, 2019 · 0 comments

Comments

@phcerdan
Copy link
Contributor

commented Oct 7, 2019

Compiling with gcc 9.1.0 generates a lot of -Wdeprecated-copy warnings.

A nice explanation on why and how to solve these warnings can be find here: intel/tbb#161

There are two types of causes for -Wdeprecated-copy warnings

  1. An assignment operator is written without a copy constructor, or a copy constructor is written without an assignment operator
  2. An assignment operator or copy constructor is made private without defining the other

A warning example:

Modules/Core/Common/include/itkVectorContainer.h:195:5: note: because ‘itk::VectorContainer<long unsigned int, itk::Point<double, 4> >::Iterator’ has user-provided ‘itk::VectorContainer<TElementIdentifier, TElement>::Iterator::Iterator(const itk::VectorContainer<TElementIdentifier, TElement>::Iterator&) [with TElementIdentifier = long unsigned int; TElement = itk::Point<double, 4>]’
  195 |     Iterator(const Iterator & r)
      |     ^~~~~~~~
Modules/Core/Transform/test/itkSplineKernelTransformTest.cxx:544:71: warning: implicitly-declared ‘itk::VectorContainer<long unsigned int, itk::Point<double, 4> >::Iterator& itk::VectorContainer<long unsigned int, itk::Point<double, 4> >::Iterator::operator=(const itk::VectorContainer<long unsigned int, itk::Point<double, 4> >::Iterator&)’ is deprecated [-Wdeprecated-copy]
  544 |   tps4DsEnd = tps4D->GetModifiableSourceLandmarks()->GetPoints()->End();
      |                                                                       ^
In file included from Modules/Core/Common/include/itkDefaultStaticMeshTraits.h:22,
                 from Modules/Core/Common/include/itkPointSet.h:32,
                 from Modules/Core/Transform/include/itkKernelTransform.h:23,
                 from Modules/Core/Transform/include/itkElasticBodySplineKernelTransform.h:21,
                 from Modules/Core/Transform/test/itkSplineKernelTransformTest.cxx:25:
Modules/Core/Common/include/itkVectorContainer.h:195:5: note: because ‘itk::VectorContainer<long unsigned int, itk::Point<double, 4> >::Iterator’ has user-provided ‘itk::VectorContainer<TElementIdentifier, TElement>::Iterator::Iterator(const itk::VectorContainer<TElementIdentifier, TElement>::Iterator&) [with TElementIdentifier = long unsigned int; TElement = itk::Point<double, 4>]’
  195 |     Iterator(const Iterator & r)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.