From b2259fbdec9c8010ed0609b9f626d5ed1711bc0e Mon Sep 17 00:00:00 2001
From: Sebastian Eibl <sebastian.eibl@fau.de>
Date: Fri, 3 Aug 2018 11:10:44 +0200
Subject: [PATCH] clang-tidy -checks=-*,modernize-use-equals-default

---
 .../BidisperseFluidizedBedDPM.cpp                  |  2 +-
 src/core/config/Config.cpp                         | 14 ++------------
 src/core/config/Config.h                           |  2 +-
 src/geometry/bodies/Sphere.cpp                     |  7 -------
 src/geometry/bodies/Sphere.h                       |  2 +-
 src/gui/Gui.cpp                                    |  2 +-
 src/gui/PropertyTree.cpp                           |  2 +-
 src/pe/contact/Contact.cpp                         |  2 +-
 src/pe/debug/BodyData.cpp                          |  2 +-
 src/pe/rigidbody/GeomPrimitive.cpp                 |  2 +-
 src/pe/rigidbody/RigidBody.cpp                     |  3 +--
 src/python_coupling/Shell.cpp                      |  2 +-
 tests/blockforest/BlockForestTest.cpp              |  4 ++--
 tests/core/logging/LoggingTest.cpp                 |  2 +-
 tests/gather/MPIGatherSchemeTest.cpp               |  4 ++--
 tests/pe/SetBodyTypeIDs.cpp                        |  2 +-
 .../HinderedSettlingDynamicsDPM.cpp                |  2 +-
 17 files changed, 19 insertions(+), 37 deletions(-)

diff --git a/apps/showcases/BidisperseFluidizedBed/BidisperseFluidizedBedDPM.cpp b/apps/showcases/BidisperseFluidizedBed/BidisperseFluidizedBedDPM.cpp
index 4673d9627..13db6651c 100644
--- a/apps/showcases/BidisperseFluidizedBed/BidisperseFluidizedBedDPM.cpp
+++ b/apps/showcases/BidisperseFluidizedBed/BidisperseFluidizedBedDPM.cpp
@@ -610,7 +610,7 @@ class DummySweep
 {
 public:
    DummySweep( )
-   {}
+   = default;
 
    void operator()(IBlock * const /*block*/)
    {}
diff --git a/src/core/config/Config.cpp b/src/core/config/Config.cpp
index 48277f3bc..54c147b00 100644
--- a/src/core/config/Config.cpp
+++ b/src/core/config/Config.cpp
@@ -64,7 +64,7 @@ Config::Config()
 // \brief Destructor for the Config class.
  */
 Config::~Config()
-{}
+= default;
 //**********************************************************************************************************************
 
 
@@ -473,16 +473,6 @@ Config::Block::Block( const std::string& key )
 //**********************************************************************************************************************
 
 
-//**********************************************************************************************************************
-/*!\fn Config::Block::Block( const Block& b )
-// \brief The copy constructor for the Block class.
- */
-Config::Block::Block( const Block& b )
-   :key_(b.key_),blocks_(b.blocks_),params_(b.params_)
-{}
-//**********************************************************************************************************************
-
-
 //**********************************************************************************************************************
 /*!\fn Config::Block& Config::Block::operator=( const Block& b )
 // \brief The copy assignment operator for the Block class.
@@ -508,7 +498,7 @@ Config::Block& Config::Block::operator=( const Block& b )
 // \brief Default destructor of the Block class.
  */
 Config::Block::~Block()
-{}
+= default;
 //**********************************************************************************************************************
 
 
diff --git a/src/core/config/Config.h b/src/core/config/Config.h
index 9ed1ce819..c915a2e4c 100644
--- a/src/core/config/Config.h
+++ b/src/core/config/Config.h
@@ -172,7 +172,7 @@ public:
    public:
       //**Constructors**************************************************************************************************
       Block( const std::string& key="" );
-      Block( const Block& b );
+      Block( const Block& b ) = default;
       //****************************************************************************************************************
 
       //**Destructor****************************************************************************************************
diff --git a/src/geometry/bodies/Sphere.cpp b/src/geometry/bodies/Sphere.cpp
index f49cae94d..f7fc0dce0 100644
--- a/src/geometry/bodies/Sphere.cpp
+++ b/src/geometry/bodies/Sphere.cpp
@@ -32,13 +32,6 @@ namespace geometry {
       updateBoxes();
    }
 
-   Sphere::Sphere( const Sphere & o )
-      : midpoint_( o.midpoint_ ),
-        radius_( o.radius_ ),
-        boundingBox_ ( o.boundingBox_ ),
-        innerBox_ ( o.innerBox_ )
-   {}
-
    void Sphere::updateBoxes()
    {
       static const real_t oneOverSqrt3 = real_t(1) / std::sqrt( real_t(3) );
diff --git a/src/geometry/bodies/Sphere.h b/src/geometry/bodies/Sphere.h
index 67330978a..f4050d044 100644
--- a/src/geometry/bodies/Sphere.h
+++ b/src/geometry/bodies/Sphere.h
@@ -48,7 +48,7 @@ namespace geometry {
    public:
 
       explicit Sphere( const Vector3<real_t> & midp, real_t rad );
-      Sphere( const Sphere & o );
+      Sphere( const Sphere & o ) = default;
 
       void setMidpoint( const Vector3<real_t> & point ) { midpoint_ = point;         updateBoxes(); }
       void setMidpoint( real_t newVal, uint_t coord )   { midpoint_[coord] = newVal; updateBoxes(); }
diff --git a/src/gui/Gui.cpp b/src/gui/Gui.cpp
index 414aa029a..e23df588e 100644
--- a/src/gui/Gui.cpp
+++ b/src/gui/Gui.cpp
@@ -220,7 +220,7 @@ GUI::GUI(timeloop::ITimeloop & timeloop, const shared_ptr<StructuredBlockForest>
 {
 }
 
-GUI::~GUI() {}
+GUI::~GUI() = default;
 
 void GUI::run() {
    timeloop_.run();
diff --git a/src/gui/PropertyTree.cpp b/src/gui/PropertyTree.cpp
index 5ac247c1e..a6dd79d5c 100644
--- a/src/gui/PropertyTree.cpp
+++ b/src/gui/PropertyTree.cpp
@@ -123,7 +123,7 @@ namespace gui {
 
 
    PropertyTree::~PropertyTree()
-   {}
+   = default;
 
 
    void PropertyTree::setBlock( IBlock * a)
diff --git a/src/pe/contact/Contact.cpp b/src/pe/contact/Contact.cpp
index 7bc7dc041..ce7c59ebe 100644
--- a/src/pe/contact/Contact.cpp
+++ b/src/pe/contact/Contact.cpp
@@ -77,7 +77,7 @@ Contact::Contact( GeomID g1, GeomID g2, const Vec3& gpos, const Vec3& normal, re
 /*!\brief Destructor for the Contact class.
  */
 Contact::~Contact()
-{}
+= default;
 //*************************************************************************************************
 
 //=================================================================================================
diff --git a/src/pe/debug/BodyData.cpp b/src/pe/debug/BodyData.cpp
index 881b65a0b..05e32e678 100644
--- a/src/pe/debug/BodyData.cpp
+++ b/src/pe/debug/BodyData.cpp
@@ -37,7 +37,7 @@ namespace debug {
 //
 //=================================================================================================
 
-BodyData::BodyData() {}
+BodyData::BodyData() = default;
 
 BodyData::BodyData(ConstBodyID rb)
    : uid(rb->getID())
diff --git a/src/pe/rigidbody/GeomPrimitive.cpp b/src/pe/rigidbody/GeomPrimitive.cpp
index ce6d2d811..0594e19a3 100644
--- a/src/pe/rigidbody/GeomPrimitive.cpp
+++ b/src/pe/rigidbody/GeomPrimitive.cpp
@@ -64,7 +64,7 @@ GeomPrimitive::GeomPrimitive( id_t const typeID, id_t sid, id_t uid, MaterialID
 /*!\brief Destructor for the Primitive class.
  */
 GeomPrimitive::~GeomPrimitive()
-{}
+= default;
 //*************************************************************************************************
 
 }  // namespace pe
diff --git a/src/pe/rigidbody/RigidBody.cpp b/src/pe/rigidbody/RigidBody.cpp
index ac99d0d5f..f30f35ce6 100644
--- a/src/pe/rigidbody/RigidBody.cpp
+++ b/src/pe/rigidbody/RigidBody.cpp
@@ -75,8 +75,7 @@ RigidBody::RigidBody( id_t const typeID, id_t sid, id_t uid )
 /*!\brief Destructor for the RigidBody class.
  */
 RigidBody::~RigidBody()
-{
-}
+= default;
 //*************************************************************************************************
 
 
diff --git a/src/python_coupling/Shell.cpp b/src/python_coupling/Shell.cpp
index 8f4379a9e..1a34e91a4 100644
--- a/src/python_coupling/Shell.cpp
+++ b/src/python_coupling/Shell.cpp
@@ -238,7 +238,7 @@ namespace walberla {
 namespace python_coupling {
 
    Shell::Shell( const std::string & )  {}
-   Shell::~Shell() {}
+   Shell::~Shell() = default;
    void Shell::operator()() {}
 
 } // namespace python_coupling
diff --git a/tests/blockforest/BlockForestTest.cpp b/tests/blockforest/BlockForestTest.cpp
index 19cda03b5..490992e90 100644
--- a/tests/blockforest/BlockForestTest.cpp
+++ b/tests/blockforest/BlockForestTest.cpp
@@ -139,7 +139,7 @@ static uint_t* blockdata5( const IBlock* const /*block*/ ) {
 class Base
 {
 public:
-   virtual ~Base() {}
+   virtual ~Base() = default;
    bool operator==( const Base& /*rhs*/ ) const { return true; }
            uint_t override() const { return 1; }
    virtual uint_t func()     const { return 2; }
@@ -169,7 +169,7 @@ static Derived* blockdataDerived( const IBlock* const /*block*/ )
 class SecondBase
 {
 public:
-   virtual ~SecondBase() {}
+   virtual ~SecondBase() = default;
    bool operator==( const SecondBase& /*rhs*/ ) const { return true; }
    uint_t override() const { return 100; }
 };
diff --git a/tests/core/logging/LoggingTest.cpp b/tests/core/logging/LoggingTest.cpp
index f3068417e..dff85f06b 100644
--- a/tests/core/logging/LoggingTest.cpp
+++ b/tests/core/logging/LoggingTest.cpp
@@ -33,7 +33,7 @@ class MyStamp : public logging::Logging::CustomStamp
 {
 public:
    MyStamp() : step_(uint_c(0)) {}
-   ~MyStamp() {}
+   ~MyStamp() = default;
    void step( uint_t s ) { step_ = s; }
    std::string stamp()
    {
diff --git a/tests/gather/MPIGatherSchemeTest.cpp b/tests/gather/MPIGatherSchemeTest.cpp
index 1bc3f7de0..ae32771d4 100644
--- a/tests/gather/MPIGatherSchemeTest.cpp
+++ b/tests/gather/MPIGatherSchemeTest.cpp
@@ -39,8 +39,8 @@ namespace walberla {
 class TestGatherPackInfo : public gather::GatherPackInfo
 {
 public:
-   TestGatherPackInfo() {}
-   virtual ~TestGatherPackInfo() {}
+   TestGatherPackInfo() = default;
+   virtual ~TestGatherPackInfo() = default;
 
 
    virtual void packData  ( const IBlock *, mpi::GenericSendBuffer<unsigned char> & outBuffer )
diff --git a/tests/pe/SetBodyTypeIDs.cpp b/tests/pe/SetBodyTypeIDs.cpp
index 9e99059b2..6cc599994 100644
--- a/tests/pe/SetBodyTypeIDs.cpp
+++ b/tests/pe/SetBodyTypeIDs.cpp
@@ -38,7 +38,7 @@ namespace pe {
 class Base{
 public:
     Base(id_t const typeID) : typeID_(typeID) {}
-    virtual ~Base() {}
+    virtual ~Base() = default;
     id_t getTypeID() const { return typeID_;}
 private:
     id_t typeID_;
diff --git a/tests/pe_coupling/discrete_particle_methods/HinderedSettlingDynamicsDPM.cpp b/tests/pe_coupling/discrete_particle_methods/HinderedSettlingDynamicsDPM.cpp
index cede11322..f8931f9f8 100644
--- a/tests/pe_coupling/discrete_particle_methods/HinderedSettlingDynamicsDPM.cpp
+++ b/tests/pe_coupling/discrete_particle_methods/HinderedSettlingDynamicsDPM.cpp
@@ -558,7 +558,7 @@ class DummySweep
 {
 public:
    DummySweep( )
-   {}
+   = default;
 
    void operator()(IBlock * const /*block*/)
    {}
-- 
GitLab