diff --git a/CMakeLists.txt b/CMakeLists.txt index c67c08024c545..4eaf719eeeb9e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -225,6 +225,7 @@ ELSE() -Wlogical-op \ -Wmissing-declarations \ -Wmissing-noreturn \ + -Wnon-virtual-dtor \ -Wold-style-cast \ -Woverloaded-virtual \ -Wpedantic \ diff --git a/Makefile b/Makefile index 8040db98917a2..5de3e461e12ce 100644 --- a/Makefile +++ b/Makefile @@ -93,6 +93,7 @@ WARNINGS = \ -Wlogical-op \ -Wmissing-declarations \ -Wmissing-noreturn \ + -Wnon-virtual-dtor \ -Wold-style-cast \ -Woverloaded-virtual \ -Wpedantic \ diff --git a/src/behavior_strategy.h b/src/behavior_strategy.h index b5a374d67d76d..587367dddb7b8 100644 --- a/src/behavior_strategy.h +++ b/src/behavior_strategy.h @@ -18,6 +18,7 @@ struct behavior_return; class strategy_t { public: + virtual ~strategy_t() = default; virtual behavior_return evaluate( const oracle_t *subject, std::vector children ) const = 0; }; diff --git a/src/inventory_ui.h b/src/inventory_ui.h index f1afe1ad7245e..331f4e2d21a2f 100644 --- a/src/inventory_ui.h +++ b/src/inventory_ui.h @@ -129,6 +129,7 @@ class inventory_selector_preset { public: inventory_selector_preset(); + virtual ~inventory_selector_preset() = default; /** Does this entry satisfy the basic preset conditions? */ virtual bool is_shown( const item_location & ) const { @@ -424,7 +425,7 @@ class inventory_selector { public: inventory_selector( player &u, const inventory_selector_preset &preset = default_preset ); - ~inventory_selector(); + virtual ~inventory_selector(); /** These functions add items from map / vehicles. */ void add_character_items( Character &character ); void add_map_items( const tripoint &target ); diff --git a/src/item_stack.h b/src/item_stack.h index 6df19649b0c6c..58da76cbf0c60 100644 --- a/src/item_stack.h +++ b/src/item_stack.h @@ -28,6 +28,7 @@ class item_stack using const_reverse_iterator = cata::colony::const_reverse_iterator; item_stack( cata::colony *items ) : items( items ) { } + virtual ~item_stack() = default; size_t size() const; bool empty() const;