Add missing virtual destructors (#1149)

* Add -Wnon-virtual-dtor -Woverloaded-virtual compiler options

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

* Add missing virtual dtors

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

* please linter

Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
This commit is contained in:
Ivan Santiago Paunovic 2020-06-01 23:58:48 -03:00 committed by GitHub
parent 819612aec6
commit 769a9d0439
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 11 additions and 4 deletions

View file

@ -23,7 +23,7 @@ if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
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()
set(${PROJECT_NAME}_SRCS

View file

@ -31,6 +31,7 @@ class RateBase
public:
RCLCPP_SMART_PTR_DEFINITIONS_NOT_COPYABLE(RateBase)
virtual ~RateBase() {}
virtual bool sleep() = 0;
virtual bool is_steady() const = 0;
virtual void reset() = 0;

View file

@ -62,6 +62,7 @@ public:
/// TimerBase destructor
RCLCPP_PUBLIC
virtual
~TimerBase();
/// Cancel the timer.