From 6a4ea82e6aed24bbc23f2454cc9f6f18e2f7d343 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Wed, 16 Jan 2019 00:39:17 +0100 Subject: [PATCH] modernize-use-equals-default --- contrib/utilities/run_clang_tidy.sh | 1 + examples/step-30/step-30.cc | 2 -- examples/step-44/step-44.cc | 9 ++------- examples/step-54/step-54.cc | 7 ------- include/deal.II/base/derivative_form.h | 14 +------------ include/deal.II/base/index_set.h | 20 ++----------------- include/deal.II/base/point.h | 2 +- include/deal.II/base/quadrature_point_data.h | 12 ----------- include/deal.II/base/tensor.h | 11 +--------- include/deal.II/grid/tria.h | 2 +- include/deal.II/lac/solver_bicgstab.h | 8 +------- include/deal.II/lac/solver_selector.h | 8 +------- include/deal.II/matrix_free/fe_evaluation.h | 16 --------------- include/deal.II/matrix_free/mapping_info.h | 5 ----- .../matrix_free/mapping_info.templates.h | 6 ------ include/deal.II/matrix_free/task_info.h | 3 +-- include/deal.II/particles/particle_handler.h | 2 +- source/grid/tria.cc | 11 ---------- source/particles/particle_handler.cc | 6 ------ 19 files changed, 13 insertions(+), 132 deletions(-) diff --git a/contrib/utilities/run_clang_tidy.sh b/contrib/utilities/run_clang_tidy.sh index fb8ec7ed78..2277ff4320 100755 --- a/contrib/utilities/run_clang_tidy.sh +++ b/contrib/utilities/run_clang_tidy.sh @@ -52,6 +52,7 @@ CHECKS="-*, modernize-deprecated-headers, modernize-redundant-void-arg, modernize-use-emplace, + modernize-use-equals-default, modernize-use-nullptr, modernize-use-using, mpi-*, diff --git a/examples/step-30/step-30.cc b/examples/step-30/step-30.cc index 10700b9fcc..0bdf2a3028 100644 --- a/examples/step-30/step-30.cc +++ b/examples/step-30/step-30.cc @@ -80,8 +80,6 @@ namespace Step30 class Beta { public: - Beta() - {} void value_list(const std::vector> &points, std::vector> & values) const; }; diff --git a/examples/step-44/step-44.cc b/examples/step-44/step-44.cc index 249b66d05a..1cbc8c8194 100644 --- a/examples/step-44/step-44.cc +++ b/examples/step-44/step-44.cc @@ -453,8 +453,7 @@ namespace Step44 , delta_t(delta_t) {} - virtual ~Time() - {} + virtual ~Time() = default; double current() const { @@ -530,9 +529,6 @@ namespace Step44 Assert(kappa > 0, ExcInternalError()); } - ~Material_Compressible_Neo_Hook_Three_Field() - {} - // We update the material model with various deformation dependent data // based on $F$ and the pressure $\widetilde{p}$ and dilatation // $\widetilde{J}$, and at the end of the function include a physical @@ -693,8 +689,7 @@ namespace Step44 , Jc(SymmetricTensor<4, dim>()) {} - virtual ~PointHistory() - {} + virtual ~PointHistory() = default; // The first function is used to create a material object and to // initialize all tensors correctly: The second one updates the stored diff --git a/examples/step-54/step-54.cc b/examples/step-54/step-54.cc index 4fab36bfb3..7ddbbd372b 100644 --- a/examples/step-54/step-54.cc +++ b/examples/step-54/step-54.cc @@ -82,9 +82,6 @@ namespace Step54 const std::string & output_filename, const ProjectionType surface_projection_kind = NormalProjection); - - ~TriangulationOnCAD(); - void run(); private: @@ -123,10 +120,6 @@ namespace Step54 , surface_projection_kind(surface_projection_kind) {} - TriangulationOnCAD::~TriangulationOnCAD() - {} - - // @sect4{TriangulationOnCAD::read_domain} diff --git a/include/deal.II/base/derivative_form.h b/include/deal.II/base/derivative_form.h index e4c6ccd23b..016540eead 100644 --- a/include/deal.II/base/derivative_form.h +++ b/include/deal.II/base/derivative_form.h @@ -59,7 +59,7 @@ public: /** * Constructor. Initialize all entries to zero. */ - DerivativeForm(); + DerivativeForm() = default; /** * Constructor from a tensor. @@ -166,18 +166,6 @@ private: #ifndef DOXYGEN - - -template -inline DerivativeForm::DerivativeForm() -{ - // default constructor. not specifying an initializer list calls - // the default constructor of the subobjects, which initialize them - // selves. therefore, the tensor array is set to zero this way -} - - - template inline DerivativeForm::DerivativeForm( const Tensor &T) diff --git a/include/deal.II/base/index_set.h b/include/deal.II/base/index_set.h index f2ec3322be..439775a130 100644 --- a/include/deal.II/base/index_set.h +++ b/include/deal.II/base/index_set.h @@ -592,13 +592,13 @@ public: /** * Copy constructor from @p other iterator. */ - IntervalIterator(const IntervalIterator &other); + IntervalIterator(const IntervalIterator &other) = default; /** * Assignment of another iterator. */ IntervalIterator & - operator=(const IntervalIterator &other); + operator=(const IntervalIterator &other) = default; /** * Prefix increment. @@ -1136,22 +1136,6 @@ inline IndexSet::IntervalIterator::IntervalIterator(const IndexSet *idxset) -inline IndexSet::IntervalIterator::IntervalIterator( - const IndexSet::IntervalIterator &other) - : accessor(other.accessor) -{} - - - -inline IndexSet::IntervalIterator & -IndexSet::IntervalIterator::operator=(const IntervalIterator &other) -{ - accessor = other.accessor; - return *this; -} - - - inline IndexSet::IntervalIterator & IndexSet::IntervalIterator::operator++() { diff --git a/include/deal.II/base/point.h b/include/deal.II/base/point.h index 8bae4ecb03..3fd26b46ce 100644 --- a/include/deal.II/base/point.h +++ b/include/deal.II/base/point.h @@ -281,7 +281,7 @@ public: // At least clang-3.7 requires us to have a user-defined constructor // and we can't use 'Point::Point () = default' here. template -inline Point::Point() +inline Point::Point() // NOLINT {} diff --git a/include/deal.II/base/quadrature_point_data.h b/include/deal.II/base/quadrature_point_data.h index 71ae9104f7..f3b81c3859 100644 --- a/include/deal.II/base/quadrature_point_data.h +++ b/include/deal.II/base/quadrature_point_data.h @@ -371,11 +371,6 @@ namespace parallel const Quadrature &mass_quadrature, const Quadrature &data_quadrature); - /** - * Destructor. - */ - ~ContinuousQuadratureDataTransfer(); - /** * Prepare for coarsening and refinement of a triangulation @p tria . * @p data_storage represents the cell data which should be transferred @@ -750,13 +745,6 @@ namespace parallel - template - ContinuousQuadratureDataTransfer:: - ~ContinuousQuadratureDataTransfer() - {} - - - template void ContinuousQuadratureDataTransfer:: diff --git a/include/deal.II/base/tensor.h b/include/deal.II/base/tensor.h index 2aabb6402e..b299ed09a7 100644 --- a/include/deal.II/base/tensor.h +++ b/include/deal.II/base/tensor.h @@ -439,7 +439,7 @@ public: * @note This function can also be used in CUDA device code. */ DEAL_II_CUDA_HOST_DEV - Tensor(); + Tensor() = default; /** * Constructor, where the data is copied from a C-style array. @@ -1010,15 +1010,6 @@ Tensor<0, dim, Number>::serialize(Archive &ar, const unsigned int) /*-------------------- Inline functions: Tensor --------------------*/ -template -inline DEAL_II_ALWAYS_INLINE DEAL_II_CUDA_HOST_DEV - Tensor::Tensor() -{ - // All members of the c-style array values are already default initialized - // and thus all values are already set to zero recursively. -} - - template inline DEAL_II_ALWAYS_INLINE Tensor::Tensor(const array_type &initializer) diff --git a/include/deal.II/grid/tria.h b/include/deal.II/grid/tria.h index b73071eaa2..1db9ec293a 100644 --- a/include/deal.II/grid/tria.h +++ b/include/deal.II/grid/tria.h @@ -1674,7 +1674,7 @@ public: * automatically generated destructor would have a different one due to * member objects. */ - virtual ~DistortedCellList() noexcept override; + virtual ~DistortedCellList() noexcept override = default; /** * A list of those cells among the coarse mesh cells that are deformed or diff --git a/include/deal.II/lac/solver_bicgstab.h b/include/deal.II/lac/solver_bicgstab.h index 3f06dc941b..90d1d7d468 100644 --- a/include/deal.II/lac/solver_bicgstab.h +++ b/include/deal.II/lac/solver_bicgstab.h @@ -175,7 +175,7 @@ public: /** * Virtual destructor. */ - virtual ~SolverBicgstab() override; + virtual ~SolverBicgstab() override = default; /** * Solve primal problem only. @@ -333,12 +333,6 @@ SolverBicgstab::SolverBicgstab(SolverControl & cn, -template -SolverBicgstab::~SolverBicgstab() -{} - - - template template double diff --git a/include/deal.II/lac/solver_selector.h b/include/deal.II/lac/solver_selector.h index 32932ba88a..d9242cfdcb 100644 --- a/include/deal.II/lac/solver_selector.h +++ b/include/deal.II/lac/solver_selector.h @@ -110,7 +110,7 @@ public: /** * Destructor */ - ~SolverSelector() override; + virtual ~SolverSelector() override = default; /** * Solver procedure. Calls the @p solve function of the @p solver whose @p @@ -256,12 +256,6 @@ SolverSelector::SolverSelector(const std::string &name, -template -SolverSelector::~SolverSelector() -{} - - - template void SolverSelector::select(const std::string &name) diff --git a/include/deal.II/matrix_free/fe_evaluation.h b/include/deal.II/matrix_free/fe_evaluation.h index 7315fd9908..e0143f51f7 100644 --- a/include/deal.II/matrix_free/fe_evaluation.h +++ b/include/deal.II/matrix_free/fe_evaluation.h @@ -2689,11 +2689,6 @@ public: const unsigned int quad_no = 0, const unsigned int first_selected_component = 0); - /** - * Destructor. - */ - ~FEFaceEvaluation(); - /** * Initializes the operation pointer to the current face. This method is the * default choice for face integration as the data stored in MappingInfo is @@ -7148,17 +7143,6 @@ inline FEFaceEvaluation:: -template -inline FEFaceEvaluation:: - ~FEFaceEvaluation() -{} - - - template struct MappingInfo { - /** - * Empty constructor. - */ - MappingInfo(); - /** * Compute the information in the given cells and faces. The cells are * specified by the level and the index within the level (as given by diff --git a/include/deal.II/matrix_free/mapping_info.templates.h b/include/deal.II/matrix_free/mapping_info.templates.h index 8da87d9807..a342afa7fd 100644 --- a/include/deal.II/matrix_free/mapping_info.templates.h +++ b/include/deal.II/matrix_free/mapping_info.templates.h @@ -192,12 +192,6 @@ namespace internal /* ------------------------ MappingInfo implementation ----------------- */ - template - MappingInfo::MappingInfo() - {} - - - template void MappingInfo::clear() diff --git a/include/deal.II/matrix_free/task_info.h b/include/deal.II/matrix_free/task_info.h index 7bbc939cf6..d7d973a22b 100644 --- a/include/deal.II/matrix_free/task_info.h +++ b/include/deal.II/matrix_free/task_info.h @@ -44,8 +44,7 @@ namespace internal struct MFWorkerInterface { public: - virtual ~MFWorkerInterface() - {} + virtual ~MFWorkerInterface() = default; /// Starts the communication for the update ghost values operation virtual void diff --git a/include/deal.II/particles/particle_handler.h b/include/deal.II/particles/particle_handler.h index ade19553b5..32b2ca23d5 100644 --- a/include/deal.II/particles/particle_handler.h +++ b/include/deal.II/particles/particle_handler.h @@ -85,7 +85,7 @@ namespace Particles /** * Destructor. */ - ~ParticleHandler() override; + virtual ~ParticleHandler() override = default; /** * Initialize the particle handler. This function does not clear the diff --git a/source/grid/tria.cc b/source/grid/tria.cc index 305a5b3782..bbe0f9a53e 100644 --- a/source/grid/tria.cc +++ b/source/grid/tria.cc @@ -15027,17 +15027,6 @@ Triangulation::memory_consumption() const } - -template -Triangulation::DistortedCellList::~DistortedCellList() noexcept -{ - // don't do anything here. the compiler will automatically convert - // any exceptions created by the destructors of the member variables - // into abort() in order to satisfy the throw()/noexcept - // specification -} - - // explicit instantiations #include "tria.inst" diff --git a/source/particles/particle_handler.cc b/source/particles/particle_handler.cc index 3d07cbb5f7..17b9fb8bf8 100644 --- a/source/particles/particle_handler.cc +++ b/source/particles/particle_handler.cc @@ -66,12 +66,6 @@ namespace Particles - template - ParticleHandler::~ParticleHandler() - {} - - - template void ParticleHandler::initialize( -- 2.39.5