Skip to content

Commit

Permalink
[kernel/mechanics] add missing non-virtual destructor
Browse files Browse the repository at this point in the history
  • Loading branch information
xhub committed Mar 7, 2016
1 parent 20ba10b commit 15102fc
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 7 deletions.
1 change: 1 addition & 0 deletions cmake/CXXCompilerSetup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ if(DEV_MODE)
add_cxx_options("-Wformat=2")
add_cxx_options("-Werror=format-security")

add_cxx_options("-Werror=non-virtual-dtor")
endif()

# add_cxx_options("-static -static-libgcc -static-libstdc++" "GNU;Clang")
Expand Down
3 changes: 2 additions & 1 deletion kernel/src/simulationTools/ExtraAdditionalTerms.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ struct ExtraAdditionalTerms {
*/
virtual void addJacobianRhsContribution(DynamicalSystemsGraph& DSG0, const DynamicalSystemsGraph::VDescriptor& dsgVD, const double h, SiconosMatrix& jacRhs) = 0;


/** Desctructor */
virtual ~ExtraAdditionalTerms() {};
};

#endif
6 changes: 6 additions & 0 deletions kernel/src/utils/SiconosTools/test/SiconosVisitorTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ struct Object {

VIRTUAL_ACCEPT_VISITORS();

virtual ~Object() {};

};

struct ObjectA : public Object
Expand All @@ -127,6 +129,8 @@ struct ObjectA : public Object
int dummya;

ACCEPT_STD_VISITORS();
virtual ~ObjectA() {};

};

struct ObjectB : public Object
Expand All @@ -135,6 +139,8 @@ struct ObjectB : public Object
int dummyb;

ACCEPT_STD_VISITORS();
virtual ~ObjectB() {};

};

#define VISITOR_CLASSES()\
Expand Down
2 changes: 1 addition & 1 deletion mechanics/src/bodies/Circle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class Circle : public CircularDS, public std11::enable_shared_from_this<Circle>

/** destructor
*/
~Circle();
virtual ~Circle();

/** visitors hook */
ACCEPT_BASE_SP_VISITORS(LagrangianDS);
Expand Down
3 changes: 0 additions & 3 deletions mechanics/src/bodies/CircularDS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,3 @@ CircularDS::CircularDS(double r, double m,
{
_ndof = 3;
}

CircularDS::~CircularDS()
{}
2 changes: 1 addition & 1 deletion mechanics/src/bodies/CircularDS.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class CircularDS : public LagrangianDS

CircularDS(double, double, SP::SiconosVector, SP::SiconosVector);

~CircularDS();
virtual ~CircularDS() {};

inline double getQ(unsigned int pos)
{
Expand Down
2 changes: 1 addition & 1 deletion mechanics/src/bodies/Disk.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class Disk : public CircularDS, public std11::enable_shared_from_this<Disk>

/** destructor
*/
~Disk();
virtual ~Disk();


/** visitors hook
Expand Down

0 comments on commit 15102fc

Please sign in to comment.