From a3de7ae49f59d517e3640695ca250d61e14feb56 Mon Sep 17 00:00:00 2001 From: Hui Xiao Date: Mon, 31 Jan 2022 10:13:11 -0800 Subject: [PATCH] Mark virtual ~Env() override (#9467) Summary: **Context:** Compiling RocksDB with -Winconsistent-missing-destructor-override reveals the following : ``` ./include/rocksdb/env.h:174:11: error: '~Env' overrides a destructor but is not marked 'override' [-Werror,-Winconsistent-missing-destructor-override] virtual ~Env(); ^ ./include/rocksdb/customizable.h:58:3: note: overridden virtual function is here ~Customizable() override {} ``` The need of overriding the Env's destructor seems to be introduced by https://github.com/facebook/rocksdb/pull/9293 and surfaced by -Winconsistent-missing-destructor-override, which is not turned on by default. **Summary:** Mark ~Env() override Pull Request resolved: https://github.com/facebook/rocksdb/pull/9467 Test Plan: - Turn on -Winconsistent-missing-destructor-override and USE_CLANG=1 make -jN env/env.o to see whether the error shows up Reviewed By: jay-zhuang, riversand963, george-reynya Differential Revision: D33864985 Pulled By: hx235 fbshipit-source-id: 4a78bd161ff153902b2676829723e9a1c33dd749 --- include/rocksdb/env.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/rocksdb/env.h b/include/rocksdb/env.h index ee8a5c9e1..21a272a13 100644 --- a/include/rocksdb/env.h +++ b/include/rocksdb/env.h @@ -171,7 +171,7 @@ class Env : public Customizable { Env(const Env&) = delete; void operator=(const Env&) = delete; - virtual ~Env(); + ~Env() override; static const char* Type() { return "Environment"; }