Skip to content

Commit

Permalink
Mark virtual ~Env() override (#9467)
Browse files Browse the repository at this point in the history
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 #9293 and surfaced by -Winconsistent-missing-destructor-override, which is not turned on by default.

**Summary:**
Mark  ~Env() override

Pull Request resolved: #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
(cherry picked from commit a3de7ae)
  • Loading branch information
hx235 committed Jan 31, 2022
1 parent d24dd13 commit d36eda0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/rocksdb/env.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"; }

Expand Down

0 comments on commit d36eda0

Please sign in to comment.