diff --git a/tests/test_class.cpp b/tests/test_class.cpp index 0b998330d..52a41a3bc 100644 --- a/tests/test_class.cpp +++ b/tests/test_class.cpp @@ -63,8 +63,9 @@ TEST_SUBMODULE(class_, m) { .def_static("new_instance", &NoConstructor::new_instance, "Return an instance"); py::class_(m, "NoConstructorNew") - .def(py::init([](NoConstructorNew *self) { return self; })) // Need a NOOP __init__ - .def_static("__new__", [](const py::object *) { return NoConstructorNew::new_instance(); } ); + .def(py::init([](const NoConstructorNew &self) { return self; })) // Need a NOOP __init__ + .def_static("__new__", + [](const py::object &) { return NoConstructorNew::new_instance(); }); // test_inheritance class Pet {