Skip to content

Commit

Permalink
Add missing virtual destructors (#553)
Browse files Browse the repository at this point in the history
* Add Wnon-virtual-dtor Woverloaded-virtual compiler options

Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>

* Add missing virtual destructor and avoid overloaded virtual warning

Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>

* Clean duplicated warning supression for clang. Delete TODO

Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>

* Please linters

Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
  • Loading branch information
ivanpauno authored Jun 2, 2020
1 parent 3576609 commit 6f8d01d
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion rviz2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if(NOT CMAKE_CXX_STANDARD)
endif()

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
add_compile_options(-Wall -Wextra -Wpedantic -Wnon-virtual-dtor -Woverloaded-virtual)
endif()

find_package(ament_cmake REQUIRED)
Expand Down
2 changes: 1 addition & 1 deletion rviz_default_plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if(NOT CMAKE_CXX_STANDARD)
endif()

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
add_compile_options(-Wall -Wextra -Wpedantic -Wnon-virtual-dtor -Woverloaded-virtual)
endif()

# Tests currently only run on OS X @ OSRF jenkins
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ using rviz_common::properties::StatusLevel;
class RVIZ_DEFAULT_PLUGINS_PUBLIC LinkUpdater
{
public:
virtual ~LinkUpdater() {}

virtual bool getLinkTransforms(
const std::string & link_name, Ogre::Vector3 & visual_position,
Ogre::Quaternion & visual_orientation,
Expand Down
2 changes: 1 addition & 1 deletion rviz_rendering/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if(NOT CMAKE_CXX_STANDARD)
endif()

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
add_compile_options(-Wall -Wextra -Wpedantic -Wnon-virtual-dtor -Woverloaded-virtual)
endif()

# Tests currently only run on OS X @ OSRF jenkins
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,14 @@ class PointCloudRenderable : public Ogre::SimpleRenderable
RVIZ_RENDERING_PUBLIC
virtual ~PointCloudRenderable();

#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Woverloaded-virtual"
#ifndef _WIN32
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Woverloaded-virtual"
#endif

RVIZ_RENDERING_PUBLIC
Ogre::RenderOperation * getRenderOperation() {return &mRenderOp;}

#ifdef __clang__
#pragma clang diagnostic pop
#ifndef _WIN32
# pragma GCC diagnostic pop
#endif

RVIZ_RENDERING_PUBLIC
Expand Down
2 changes: 1 addition & 1 deletion rviz_rendering_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if(NOT CMAKE_CXX_STANDARD)
endif()

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
add_compile_options(-Wall -Wextra -Wpedantic -Wnon-virtual-dtor -Woverloaded-virtual)
endif()

# Tests currently only run on OS X @ OSRF jenkins
Expand Down
2 changes: 1 addition & 1 deletion rviz_visual_testing_framework/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if(NOT CMAKE_CXX_STANDARD)
endif()

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
add_compile_options(-Wall -Wextra -Wpedantic -Wnon-virtual-dtor -Woverloaded-virtual)
endif()

find_package(ament_cmake REQUIRED)
Expand Down

0 comments on commit 6f8d01d

Please sign in to comment.