From ac679063535e4efaeea7a7fb779c2a00e0535292 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Fri, 15 Sep 2017 09:56:57 +0200 Subject: [PATCH] Fix default definitions in header files --- include/deal.II/base/parallel.h | 7 +------ include/deal.II/base/point.h | 3 ++- include/deal.II/base/table.h | 8 +------- include/deal.II/grid/tria_boundary.h | 2 +- include/deal.II/lac/petsc_parallel_block_vector.h | 4 +--- include/deal.II/lac/pointer_matrix.h | 10 +--------- include/deal.II/lac/precondition_block.h | 2 +- include/deal.II/lac/precondition_block.templates.h | 3 --- include/deal.II/lac/solver_cg.h | 7 +------ include/deal.II/matrix_free/operators.h | 7 +------ source/base/function_parser.cc | 2 +- source/grid/tria_boundary.cc | 6 ++++++ 12 files changed, 17 insertions(+), 44 deletions(-) diff --git a/include/deal.II/base/parallel.h b/include/deal.II/base/parallel.h index 74a2c3b18b..4a683dd446 100644 --- a/include/deal.II/base/parallel.h +++ b/include/deal.II/base/parallel.h @@ -477,7 +477,7 @@ namespace parallel * Destructor. Made virtual to ensure that derived classes also have * virtual destructors. */ - virtual ~ParallelForInteger (); + virtual ~ParallelForInteger () = default; /** * This function runs the for loop over the given range @@ -843,11 +843,6 @@ namespace parallel #endif - inline - ParallelForInteger::~ParallelForInteger () = default; - - - inline void ParallelForInteger::apply_parallel (const std::size_t begin, diff --git a/include/deal.II/base/point.h b/include/deal.II/base/point.h index 40b387abcd..103582dbde 100644 --- a/include/deal.II/base/point.h +++ b/include/deal.II/base/point.h @@ -253,7 +253,8 @@ public: // and we can't use 'Point::Point () = default' here. template inline -Point::Point () = default; +Point::Point () +{} diff --git a/include/deal.II/base/table.h b/include/deal.II/base/table.h index 8022846389..cfebb63c63 100644 --- a/include/deal.II/base/table.h +++ b/include/deal.II/base/table.h @@ -452,7 +452,7 @@ public: /** * Destructor. Free allocated memory. */ - ~TableBase (); + ~TableBase () = default; /** * Assignment operator. Copy all elements of src into the matrix. @@ -1797,12 +1797,6 @@ namespace internal -template -inline -TableBase::~TableBase () = default; - - - template inline TableBase & diff --git a/include/deal.II/grid/tria_boundary.h b/include/deal.II/grid/tria_boundary.h index 84d20d893c..65e170673c 100644 --- a/include/deal.II/grid/tria_boundary.h +++ b/include/deal.II/grid/tria_boundary.h @@ -241,7 +241,7 @@ public: /** * Default constructor. Some compilers require this for some reasons. */ - StraightBoundary () = default; + StraightBoundary (); /** * Let the new point be the arithmetic mean of the two vertices of the line. diff --git a/include/deal.II/lac/petsc_parallel_block_vector.h b/include/deal.II/lac/petsc_parallel_block_vector.h index f3162c43d7..5c6bc666e8 100644 --- a/include/deal.II/lac/petsc_parallel_block_vector.h +++ b/include/deal.II/lac/petsc_parallel_block_vector.h @@ -136,7 +136,7 @@ namespace PETScWrappers /** * Destructor. Clears memory */ - ~BlockVector (); + ~BlockVector () = default; /** * Copy operator: fill all components of the vector that are locally @@ -356,8 +356,6 @@ namespace PETScWrappers return *this; } - inline - BlockVector::~BlockVector () = default; inline diff --git a/include/deal.II/lac/pointer_matrix.h b/include/deal.II/lac/pointer_matrix.h index 50cf9e7f7c..36750f2dcf 100644 --- a/include/deal.II/lac/pointer_matrix.h +++ b/include/deal.II/lac/pointer_matrix.h @@ -68,7 +68,7 @@ public: * of any derived class is called whenever a pointer-to-base-class object is * destroyed. */ - virtual ~PointerMatrixBase (); + virtual ~PointerMatrixBase () = default; /** * Reset the object to its original state. @@ -581,14 +581,6 @@ new_pointer_matrix_base(const TridiagonalMatrix &matrix, const Vector -inline -PointerMatrixBase::~PointerMatrixBase () = default; - - - -//----------------------------------------------------------------------// - template PointerMatrix::PointerMatrix (const MatrixType *M) diff --git a/include/deal.II/lac/precondition_block.h b/include/deal.II/lac/precondition_block.h index f74ed6874b..aa83f867b4 100644 --- a/include/deal.II/lac/precondition_block.h +++ b/include/deal.II/lac/precondition_block.h @@ -155,7 +155,7 @@ public: /** * Destructor. */ - ~PreconditionBlock(); + ~PreconditionBlock() = default; /** * Initialize matrix and block size. We store the matrix and the block size diff --git a/include/deal.II/lac/precondition_block.templates.h b/include/deal.II/lac/precondition_block.templates.h index d2c8f8c897..6d0a65ec47 100644 --- a/include/deal.II/lac/precondition_block.templates.h +++ b/include/deal.II/lac/precondition_block.templates.h @@ -55,9 +55,6 @@ PreconditionBlock::PreconditionBlock (bool store) {} -template -PreconditionBlock::~PreconditionBlock () = default; - template void PreconditionBlock::clear () diff --git a/include/deal.II/lac/solver_cg.h b/include/deal.II/lac/solver_cg.h index 8fca65a304..3d784e5867 100644 --- a/include/deal.II/lac/solver_cg.h +++ b/include/deal.II/lac/solver_cg.h @@ -120,7 +120,7 @@ public: /** * Virtual destructor. */ - virtual ~SolverCG (); + virtual ~SolverCG () = default; /** * Solve the linear system $Ax=b$ for x. @@ -248,11 +248,6 @@ SolverCG::SolverCG (SolverControl &cn, -template -SolverCG::~SolverCG () = default; - - - template void SolverCG::print_vectors(const unsigned int, diff --git a/include/deal.II/matrix_free/operators.h b/include/deal.II/matrix_free/operators.h index b2acd5ece4..91a5967ef0 100644 --- a/include/deal.II/matrix_free/operators.h +++ b/include/deal.II/matrix_free/operators.h @@ -182,7 +182,7 @@ namespace MatrixFreeOperators /** * Virtual destructor. */ - virtual ~Base(); + virtual ~Base() = default; /** * Release all memory and return to a state just like after having called @@ -882,11 +882,6 @@ namespace MatrixFreeOperators } //----------------- Base operator ----------------------------- - template - Base::~Base () = default; - - - template Base::Base () : diff --git a/source/base/function_parser.cc b/source/base/function_parser.cc index 6345390c34..0a50b67336 100644 --- a/source/base/function_parser.cc +++ b/source/base/function_parser.cc @@ -57,7 +57,7 @@ FunctionParser::FunctionParser(const unsigned int n_components, -// We deliberately delay the definition of the default constructor +// We deliberately delay the definition of the default destructor // so that we don't need to include the definition of mu::Parser // in the header file. template diff --git a/source/grid/tria_boundary.cc b/source/grid/tria_boundary.cc index aa13cfb072..250dd5dbae 100644 --- a/source/grid/tria_boundary.cc +++ b/source/grid/tria_boundary.cc @@ -180,6 +180,12 @@ get_line_support_points (const unsigned int n_intermediate_points) const /* -------------------------- StraightBoundary --------------------- */ +// At least clang < 3.9.0 complains if we move this definition to its +// declaration when a 'const StraightBoundary' object is built. +template +StraightBoundary::StraightBoundary () = default; + + template Point -- 2.39.5