Add missing |noexcept| keyword to our move-constructors.
Noticed while woring on follow-up cl at
https://pdfium-review.googlesource.com/c/pdfium/+/73510
Change-Id: Ic2a3d780a8692378107ada25dc6e428bf28153e8
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/73511
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/core/fxcrt/bytestring.cpp b/core/fxcrt/bytestring.cpp
index 7563db4..b91e733 100644
--- a/core/fxcrt/bytestring.cpp
+++ b/core/fxcrt/bytestring.cpp
@@ -215,7 +215,7 @@
return *this;
}
-ByteString& ByteString::operator=(ByteString&& that) {
+ByteString& ByteString::operator=(ByteString&& that) noexcept {
if (m_pData != that.m_pData)
m_pData = std::move(that.m_pData);
diff --git a/core/fxcrt/bytestring.h b/core/fxcrt/bytestring.h
index 7c7f2ee..ec927b1 100644
--- a/core/fxcrt/bytestring.h
+++ b/core/fxcrt/bytestring.h
@@ -134,7 +134,7 @@
ByteString& operator=(const ByteString& that);
// Move-assign a ByteString. After assignment, |that| is empty.
- ByteString& operator=(ByteString&& that);
+ ByteString& operator=(ByteString&& that) noexcept;
ByteString& operator+=(char ch);
ByteString& operator+=(const char* str);
diff --git a/core/fxcrt/maybe_owned.h b/core/fxcrt/maybe_owned.h
index bbdcd40..4e46864 100644
--- a/core/fxcrt/maybe_owned.h
+++ b/core/fxcrt/maybe_owned.h
@@ -63,7 +63,7 @@
}
MaybeOwned& operator=(const MaybeOwned& that) = delete;
- MaybeOwned& operator=(MaybeOwned&& that) {
+ MaybeOwned& operator=(MaybeOwned&& that) noexcept {
m_pObj = that.m_pObj;
m_pOwnedObj = std::move(that.m_pOwnedObj);
that.m_pObj = nullptr;
diff --git a/core/fxcrt/retain_ptr.h b/core/fxcrt/retain_ptr.h
index d58cbf0..b9fd495 100644
--- a/core/fxcrt/retain_ptr.h
+++ b/core/fxcrt/retain_ptr.h
@@ -69,7 +69,7 @@
}
// Move-assign a RetainPtr. After assignment, |that| will be NULL.
- RetainPtr& operator=(RetainPtr&& that) {
+ RetainPtr& operator=(RetainPtr&& that) noexcept {
m_pObj.reset(that.Leak());
return *this;
}
diff --git a/core/fxcrt/widestring.cpp b/core/fxcrt/widestring.cpp
index b51ed68..813f2b8 100644
--- a/core/fxcrt/widestring.cpp
+++ b/core/fxcrt/widestring.cpp
@@ -410,7 +410,7 @@
return *this;
}
-WideString& WideString::operator=(WideString&& that) {
+WideString& WideString::operator=(WideString&& that) noexcept {
if (m_pData != that.m_pData)
m_pData = std::move(that.m_pData);
diff --git a/core/fxcrt/widestring.h b/core/fxcrt/widestring.h
index ff53684..b455184 100644
--- a/core/fxcrt/widestring.h
+++ b/core/fxcrt/widestring.h
@@ -117,7 +117,7 @@
WideString& operator=(const WideString& that);
// Move-assign a WideString. After assignment, |that| is empty.
- WideString& operator=(WideString&& that);
+ WideString& operator=(WideString&& that) noexcept;
WideString& operator+=(const wchar_t* str);
WideString& operator+=(wchar_t ch);