From d6dacfecb1add4bfd3e4d0aeea5047dd95206588 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Fri, 14 Jul 2023 16:50:23 +0200 Subject: [PATCH] Fix warning in recently-added testlib snippet MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Amends commit fa296ee1dcf4c16fb6f242cf08949485e499fec3 to implement MyObject::startup(), mark it void (its return was ignored) and flag its static wrapper as [[maybe_unused]] to calm a compiler warning. As a drive-by, fix indentation of the class definition. Change-Id: I3918bf8a4625a7e2b4e6d4e0cbfa68a337115865 Reviewed-by: Ahmad Samir Reviewed-by: MÃ¥rten Nordheim --- .../code/src_corelib_kernel_qtestsupport_core.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/testlib/doc/snippets/code/src_corelib_kernel_qtestsupport_core.cpp b/src/testlib/doc/snippets/code/src_corelib_kernel_qtestsupport_core.cpp index 30c6dfec9f4..7faf40d9b7f 100644 --- a/src/testlib/doc/snippets/code/src_corelib_kernel_qtestsupport_core.cpp +++ b/src/testlib/doc/snippets/code/src_corelib_kernel_qtestsupport_core.cpp @@ -5,9 +5,9 @@ // dummy class class MyObject { - public: - int isReady(); - bool startup(); +public: + int isReady(); + void startup() {} }; // dummy function @@ -27,7 +27,7 @@ int MyObject::isReady() return 1; } -static bool startup() +[[maybe_unused]] static bool startup() { //! [2] MyObject obj;