From 6bbcfa482e753b845f0d992dad5a9c3abc7bf691 Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Mon, 13 May 2019 15:50:40 +0200 Subject: [PATCH] gcc9 warning: Provide copy constructor for class with operator= --- include/deal.II/lac/petsc_vector.h | 5 +++++ source/lac/petsc_parallel_vector.cc | 8 ++++++++ 2 files changed, 13 insertions(+) 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) { -- 2.39.5