From f121f319b9a90e58eda1bf3fb186d4e8a7861ad2 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Fri, 27 Sep 2019 16:17:22 +0200 Subject: examples: Fix -Wdeprecated-copy warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit examples/corelib/tools/customtypesending/window.cpp: In member function ‘void Window::sendMessage()’: examples/corelib/tools/customtypesending/window.cpp:79:71: warning: implicitly-declared ‘Message& Message::operator=(const Message&)’ is deprecated [-Wdeprecated-copy] 79 | thisMessage = Message(editor->toPlainText(), thisMessage.headers()); | ^ In file included from examples/corelib/tools/customtypesending/window.h:55, from examples/corelib/tools/customtypesending/window.cpp:52: examples/corelib/tools/customtypesending/message.h:62:5: note: because ‘Message’ has user-provided ‘Message::Message(const Message&)’ 62 | Message(const Message &other); | ^~~~~~~ examples/corelib/tools/customtypesending/window.cpp: In member function ‘void Window::setMessage(const Message&)’: examples/corelib/tools/customtypesending/window.cpp:87:19: warning: implicitly-declared ‘Message& Message::operator=(const Message&)’ is deprecated [-Wdeprecated-copy] 87 | thisMessage = message; | ^~~~~~~ In file included from examples/corelib/tools/customtypesending/window.h:55, from examples/corelib/tools/customtypesending/window.cpp:52: examples/corelib/tools/customtypesending/message.h:62:5: note: because ‘Message’ has user-provided ‘Message::Message(const Message&)’ 62 | Message(const Message &other); | ^~~~~~~ Change-Id: I563d53f7dd1e0e0dc5fd4db06299b2d0a70c62ff Reviewed-by: Edward Welbourne --- examples/corelib/tools/customtype/message.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'examples/corelib/tools/customtype/message.h') diff --git a/examples/corelib/tools/customtype/message.h b/examples/corelib/tools/customtype/message.h index c1b8243237..bc30c45425 100644 --- a/examples/corelib/tools/customtype/message.h +++ b/examples/corelib/tools/customtype/message.h @@ -58,9 +58,10 @@ class Message { public: - Message(); - Message(const Message &other); - ~Message(); + Message() = default; + ~Message() = default; + Message(const Message &) = default; + Message &operator=(const Message &) = default; Message(const QString &body, const QStringList &headers); -- cgit v1.2.3