Commit 0029def9 authored by Joe Loser's avatar Joe Loser Committed by Facebook Github Bot

Fix Clang 8 -Wdefaulted-function-deleted errors (#1082)

Summary:
- Clang 8 introduces a new compiler option which is turned on by
  default: `-Wdefaulted-function-deleted`.
- This flags some code which has special member functions which we
  declare as defaulted, but are implicitly deleted. As such, it is a bit
  misleading to mark them as defaulted. So, mark them as deleted. We
  could also remove them and they would be implicitly deleted, but then
  the internal linter would not like that we define a user defined type
  but are not explicit about deleting or defaulting all special member
  functions.

Note:
- This fixes some Clang 8 compilation issues, but
  https://github.com/facebook/folly/issues/1081 contains details about the
  remaining issues.
Pull Request resolved: https://github.com/facebook/folly/pull/1082

Reviewed By: Orvid

Differential Revision: D14613574

Pulled By: yfeldblum

fbshipit-source-id: 8011b3bc456bf92bbaf374c045fffb130e26d38b
parent 6b559d40
...@@ -35,6 +35,8 @@ class EventBaseThread { ...@@ -35,6 +35,8 @@ class EventBaseThread {
explicit EventBaseThread(EventBaseManager* ebm); explicit EventBaseThread(EventBaseManager* ebm);
~EventBaseThread(); ~EventBaseThread();
EventBaseThread(EventBaseThread const&) = delete;
EventBaseThread& operator=(EventBaseThread const&) = delete;
EventBaseThread(EventBaseThread&&) noexcept; EventBaseThread(EventBaseThread&&) noexcept;
EventBaseThread& operator=(EventBaseThread&&) noexcept; EventBaseThread& operator=(EventBaseThread&&) noexcept;
...@@ -45,9 +47,6 @@ class EventBaseThread { ...@@ -45,9 +47,6 @@ class EventBaseThread {
void stop(); void stop();
private: private:
EventBaseThread(EventBaseThread const&) = default;
EventBaseThread& operator=(EventBaseThread const&) = default;
EventBaseManager* ebm_; EventBaseManager* ebm_;
std::unique_ptr<ScopedEventBaseThread> th_; std::unique_ptr<ScopedEventBaseThread> th_;
}; };
......
...@@ -43,7 +43,7 @@ struct Watchdog { ...@@ -43,7 +43,7 @@ struct Watchdog {
Watchdog(const Watchdog&) = delete; Watchdog(const Watchdog&) = delete;
Watchdog& operator=(const Watchdog&) = delete; Watchdog& operator=(const Watchdog&) = delete;
Watchdog(Watchdog&&) noexcept = default; Watchdog(Watchdog&&) noexcept = default;
Watchdog& operator=(Watchdog&&) noexcept = default; Watchdog& operator=(Watchdog&&) noexcept = delete;
}; };
// Some basic types we use for tracking. // Some basic types we use for tracking.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment