diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2023-07-14 16:50:23 +0200 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2023-07-18 15:28:07 +0200 |
commit | d6dacfecb1add4bfd3e4d0aeea5047dd95206588 (patch) | |
tree | 0852771a7d7ee1d32f30ba5e0d0cb1f74527cb7a | |
parent | 892448b6e027236228b2c6429a6453c038b5c403 (diff) |
Fix warning in recently-added testlib snippet
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 <a.samirh78@gmail.com>
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
-rw-r--r-- | src/testlib/doc/snippets/code/src_corelib_kernel_qtestsupport_core.cpp | 8 |
1 files 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 30c6dfec9f..7faf40d9b7 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; |