Skip to content

Commit 1161c1c

Browse files
r-barnesfacebook-github-bot
authored andcommitted
Fix deprecated behaviour in gloo/rendezvous/store.h
Summary: Future C++ standards and compiler upgrades will eliminate deprecated behaviour. `-Wdeprecated` identifies this behaviour and has found some in this code! Some examples. **Dynamic exceptions** ``` error: dynamic exception specifications are deprecated [-Werror,-Wdeprecated-dynamic-exception-spec] ``` `throw(...)` has been deprecated since C++11 and removed in C++17. In most cases we can just use `noexcept` in the rest, we can remove this. **Implicit copy constructors** ``` error: definition of implicit copy constructor for 'XXX' is deprecated because it has a user-declared destructor [-Werror,-Wdeprecated-copy-with-dtor] ``` If you define a destructor, you need to explicitly define a copy constructor. **Out-ofline constexpr static** ``` error: out-of-line definition of constexpr static data member is redundant in C++17 and is deprecated [-Werror,-Wdeprecated] ``` This can be simplified: ``` class MyClass { static constexpr my_const = 3; }; static constexpr MyClass::my_const; // <- No longer needed! ``` Reviewed By: meyering Differential Revision: D54158184 fbshipit-source-id: f3b98790d6592ac21e6d002b2d0d914bc331735d
1 parent d1846ca commit 1161c1c

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

gloo/rendezvous/store.cc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@
1111
namespace gloo {
1212
namespace rendezvous {
1313

14-
constexpr std::chrono::milliseconds Store::kDefaultTimeout;
15-
16-
// Have to provide implementation for pure virtual destructor.
17-
Store::~Store() {}
1814

1915
} // namespace rendezvous
2016
} // namespace gloo

gloo/rendezvous/store.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class Store: public IStore {
2727
static constexpr std::chrono::milliseconds kDefaultTimeout =
2828
std::chrono::seconds(30);
2929

30-
virtual ~Store();
30+
virtual ~Store() = default;
3131

3232
virtual void set(const std::string& key, const std::vector<char>& data) = 0;
3333

0 commit comments

Comments
 (0)