test,AbstractBench: fix -Wnon-virtual-dtor
authorJames Zern <jzern@google.com>
Sat, 8 Jul 2023 02:14:59 +0000 (19:14 -0700)
committerJames Zern <jzern@google.com>
Tue, 25 Jul 2023 00:07:51 +0000 (17:07 -0700)
In file included from ../test/bench.cc:14:
../test/bench.h:17:7: warning: 'AbstractBench' has virtual functions but
non-virtual destructor [-Wnon-virtual-dtor]
class AbstractBench {

Change-Id: Ibbfb949b63c8dff936c7ed4f2d056dea0343377b

configure
test/bench.h

index 67bba94..aef65a8 100755 (executable)
--- a/configure
+++ b/configure
@@ -679,6 +679,7 @@ process_toolchain() {
         check_add_cxxflags -Wc++14-extensions
         check_add_cxxflags -Wc++17-extensions
         check_add_cxxflags -Wc++20-extensions
+        check_add_cxxflags -Wnon-virtual-dtor
 
         # disable some warnings specific to libyuv / libwebm.
         check_cxxflags -Wno-missing-declarations \
index 57ca911..203e4d2 100644 (file)
@@ -16,6 +16,8 @@
 
 class AbstractBench {
  public:
+  virtual ~AbstractBench() = default;
+
   void RunNTimes(int n);
   void PrintMedian(const char *title);