diff --git a/include/pybind11/pybind11.h b/include/pybind11/pybind11.h index 21e130b5d..38696d12c 100644 --- a/include/pybind11/pybind11.h +++ b/include/pybind11/pybind11.h @@ -314,7 +314,7 @@ protected: rec->def = new PyMethodDef(); std::memset(rec->def, 0, sizeof(PyMethodDef)); rec->def->ml_name = rec->name; - rec->def->ml_meth = reinterpret_cast(*dispatcher); + rec->def->ml_meth = reinterpret_cast(reinterpret_cast(*dispatcher)); rec->def->ml_flags = METH_VARARGS | METH_KEYWORDS; capsule rec_capsule(rec, [](void *ptr) {