Commit 4746202f authored by tzik's avatar tzik Committed by Commit Bot

Add missing noexcept specifiers to move ctors and assigns

The declarations of move ctors and assigns of
DisjointRangeLockManager::LockRequest, ScopesLockManager::ScopeLock and
ResolveProxyMsgHelper::PendingRequest have `noexcept` specifier, but
their implementations don't. This is OK in C++14, but causes compile
errors in C++17.

This CL adds missing `noexcept` for them.

Bug: 752720
Change-Id: I849f613c63c990afd23c590a9567069b772146d1
Reviewed-on: https://chromium-review.googlesource.com/1175656Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Taiju Tsuiki <tzik@chromium.org>
Cr-Commit-Position: refs/heads/master@{#583319}
parent 22fb8788
...@@ -10,13 +10,14 @@ DisjointRangeLockManager::LockRequest::LockRequest() = default; ...@@ -10,13 +10,14 @@ DisjointRangeLockManager::LockRequest::LockRequest() = default;
DisjointRangeLockManager::LockRequest::LockRequest(LockType type, DisjointRangeLockManager::LockRequest::LockRequest(LockType type,
LockAquiredCallback callback) LockAquiredCallback callback)
: requested_type(type), callback(std::move(callback)) {} : requested_type(type), callback(std::move(callback)) {}
DisjointRangeLockManager::LockRequest::LockRequest(LockRequest&&) = default; DisjointRangeLockManager::LockRequest::LockRequest(LockRequest&&) noexcept =
default;
DisjointRangeLockManager::LockRequest::~LockRequest() = default; DisjointRangeLockManager::LockRequest::~LockRequest() = default;
DisjointRangeLockManager::Lock::Lock() = default; DisjointRangeLockManager::Lock::Lock() = default;
DisjointRangeLockManager::Lock::Lock(Lock&&) = default; DisjointRangeLockManager::Lock::Lock(Lock&&) noexcept = default;
DisjointRangeLockManager::Lock::~Lock() = default; DisjointRangeLockManager::Lock::~Lock() = default;
DisjointRangeLockManager::Lock& DisjointRangeLockManager::Lock::operator=( DisjointRangeLockManager::Lock& DisjointRangeLockManager::Lock::operator=(
DisjointRangeLockManager::Lock&&) = default; DisjointRangeLockManager::Lock&&) noexcept = default;
DisjointRangeLockManager::DisjointRangeLockManager( DisjointRangeLockManager::DisjointRangeLockManager(
int level_count, int level_count,
......
...@@ -12,7 +12,7 @@ ScopesLockManager::LockRange::LockRange(std::string begin, std::string end) ...@@ -12,7 +12,7 @@ ScopesLockManager::LockRange::LockRange(std::string begin, std::string end)
: begin(std::move(begin)), end(std::move(end)) {} : begin(std::move(begin)), end(std::move(end)) {}
ScopesLockManager::ScopeLock::ScopeLock() = default; ScopesLockManager::ScopeLock::ScopeLock() = default;
ScopesLockManager::ScopeLock::ScopeLock(ScopeLock&& other) { ScopesLockManager::ScopeLock::ScopeLock(ScopeLock&& other) noexcept {
DCHECK(!this->is_locked_) << "Cannot move a lock onto an active lock."; DCHECK(!this->is_locked_) << "Cannot move a lock onto an active lock.";
this->is_locked_ = other.is_locked_; this->is_locked_ = other.is_locked_;
this->range_ = std::move(other.range_); this->range_ = std::move(other.range_);
...@@ -29,7 +29,7 @@ ScopesLockManager::ScopeLock::ScopeLock(LockRange range, ...@@ -29,7 +29,7 @@ ScopesLockManager::ScopeLock::ScopeLock(LockRange range,
closure_runner_(std::move(closure)) {} closure_runner_(std::move(closure)) {}
ScopesLockManager::ScopeLock& ScopesLockManager::ScopeLock::operator=( ScopesLockManager::ScopeLock& ScopesLockManager::ScopeLock::operator=(
ScopesLockManager::ScopeLock&& other) { ScopesLockManager::ScopeLock&& other) noexcept {
DCHECK(!this->is_locked_); DCHECK(!this->is_locked_);
this->is_locked_ = other.is_locked_; this->is_locked_ = other.is_locked_;
this->range_ = std::move(other.range_); this->range_ = std::move(other.range_);
......
...@@ -125,7 +125,7 @@ ResolveProxyMsgHelper::PendingRequest::PendingRequest(const GURL& url, ...@@ -125,7 +125,7 @@ ResolveProxyMsgHelper::PendingRequest::PendingRequest(const GURL& url,
: url(url), reply_msg(reply_msg) {} : url(url), reply_msg(reply_msg) {}
ResolveProxyMsgHelper::PendingRequest::PendingRequest( ResolveProxyMsgHelper::PendingRequest::PendingRequest(
PendingRequest&& pending_request) = default; PendingRequest&& pending_request) noexcept = default;
ResolveProxyMsgHelper::PendingRequest::~PendingRequest() noexcept = default; ResolveProxyMsgHelper::PendingRequest::~PendingRequest() noexcept = default;
......
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