Index: Source/wtf/text/WTFString.h |
diff --git a/Source/wtf/text/WTFString.h b/Source/wtf/text/WTFString.h |
index 13078127885b7c8233cbb1e20515fdbd60125df8..094282f676ad541cf45d571d94306af75cb77eb3 100644 |
--- a/Source/wtf/text/WTFString.h |
+++ b/Source/wtf/text/WTFString.h |
@@ -123,13 +123,13 @@ public: |
String(StringImpl* impl) : m_impl(impl) { } |
String(PassRefPtr<StringImpl> impl) : m_impl(impl) { } |
-#if COMPILER_SUPPORTS(CXX_RVALUE_REFERENCES) |
- // We have to declare the copy constructor and copy assignment operator as well, otherwise |
- // they'll be implicitly deleted by adding the move constructor and move assignment operator. |
- String(const String& other) : m_impl(other.m_impl) { } |
- String(String&& other) : m_impl(other.m_impl.release()) { } |
- String& operator=(const String& other) { m_impl = other.m_impl; return *this; } |
- String& operator=(String&& other) { m_impl = other.m_impl.release(); return *this; } |
+#if COMPILER_SUPPORTS(CXX_RVALUE_REFERENCES) && COMPILER_SUPPORTS(CXX_DEFAULTED_FUNCTIONS) |
+ // We have to explicitly declare the move constructor and move copy assignment operator. The compiler does |
+ // not generate them because the class has an explicitly defined destructor. |
+ String(const String&) = default; |
+ String(String&&) = default; |
+ String& operator=(const String&) = default; |
+ String& operator=(String&&) = default; |
#endif |
// Inline the destructor. |