From: Martin Kronbichler Date: Mon, 13 May 2019 13:50:40 +0000 (+0200) Subject: gcc9 warning: Provide copy constructor for class with operator= X-Git-Tag: v9.1.0-rc1~12^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6bbcfa482e753b845f0d992dad5a9c3abc7bf691;p=dealii.git gcc9 warning: Provide copy constructor for class with operator= --- diff --git a/include/deal.II/lac/petsc_vector.h b/include/deal.II/lac/petsc_vector.h index 1c43760ac1..ab08a6ba69 100644 --- a/include/deal.II/lac/petsc_vector.h +++ b/include/deal.II/lac/petsc_vector.h @@ -262,6 +262,11 @@ namespace PETScWrappers */ explicit Vector(const IndexSet &local, const MPI_Comm &communicator); + /** + * Copy constructor. + */ + Vector(const Vector &v); + /** * Release all memory and return to a state just like after having * called the default constructor. diff --git a/source/lac/petsc_parallel_vector.cc b/source/lac/petsc_parallel_vector.cc index f0a12353b2..da90e9ab77 100644 --- a/source/lac/petsc_parallel_vector.cc +++ b/source/lac/petsc_parallel_vector.cc @@ -85,6 +85,14 @@ namespace PETScWrappers + Vector::Vector(const Vector &v) + : VectorBase() + { + this->operator=(v); + } + + + Vector::Vector(const IndexSet &local, const MPI_Comm &communicator) : communicator(communicator) {