Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile flags non-virtual-destructor #3609

Merged
merged 6 commits into from
Jun 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion nav2_common/cmake/nav2_package.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ macro(nav2_package)
endif()

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

option(COVERAGE_ENABLED "Enable code coverage" FALSE)
Expand Down
2 changes: 1 addition & 1 deletion nav2_core/include/nav2_core/behavior_tree_navigator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class NavigatorBase
{
public:
NavigatorBase() = default;
~NavigatorBase() = default;
virtual ~NavigatorBase() = default;

/**
* @brief Configuration of the navigator's backend BT and actions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ class MapBasedQueue
reset();
}

/**
* @brief Default virtual Destructor
*/
virtual ~MapBasedQueue() = default;

/**
* @brief Clear the queue
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ class CriticManager
*/
CriticManager() = default;


/**
* @brief Virtual Destructor for mppi::CriticManager
*/
virtual ~CriticManager() = default;

/**
* @brief Configure critic manager on bringup and load plugins
* @param parent WeakPtr to node
Expand Down
4 changes: 4 additions & 0 deletions nav2_mppi_controller/test/critic_manager_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ class CriticManagerWrapper : public CriticManager
CriticManagerWrapper()
: CriticManager() {}

virtual ~CriticManagerWrapper() = default;

virtual void loadCritics()
{
critics_.clear();
Expand Down Expand Up @@ -78,6 +80,8 @@ class CriticManagerWrapperEnum : public CriticManager
CriticManagerWrapperEnum()
: CriticManager() {}

virtual ~CriticManagerWrapperEnum() = default;

unsigned int getCriticNum()
{
return critics_.size();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class DummyActionServer
std::bind(&DummyActionServer::handle_accepted, this, _1));
}

virtual ~DummyActionServer() = default;
void setFailureRanges(const Ranges & failureRanges)
{
failure_ranges_ = failureRanges;
Expand Down
2 changes: 2 additions & 0 deletions nav2_system_tests/src/behavior_tree/dummy_service.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ class DummyService
std::bind(&DummyService::handle_service, this, _1, _2, _3));
}

virtual ~DummyService() = default;

void disable()
{
service_.reset();
Expand Down