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>
This commit is contained in:
Edward Welbourne 2023-07-14 16:50:23 +02:00
parent 892448b6e0
commit d6dacfecb1

View File

@ -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;