diff --git a/tests/test_cases_for_stubgen.cpp b/tests/test_cases_for_stubgen.cpp index 7b55ce699..6e8128648 100644 --- a/tests/test_cases_for_stubgen.cpp +++ b/tests/test_cases_for_stubgen.cpp @@ -83,6 +83,7 @@ void bind_basics(py::module &basics) { pyPoint.def(py::init<>()) .def(py::init(), py::arg("x"), py::arg("y")) +#ifdef PYBIND11_CPP14 .def("distance_to", py::overload_cast(&Point::distance_to, py::const_), py::arg("x"), @@ -90,6 +91,15 @@ void bind_basics(py::module &basics) { .def("distance_to", py::overload_cast(&Point::distance_to, py::const_), py::arg("other")) +#else + .def("distance_to", + static_cast(&Point::distance_to), + py::arg("x"), + py::arg("y")) + .def("distance_to", + static_cast(&Point::distance_to), + py::arg("other")) +#endif .def_readwrite("x", &Point::x) .def_property( "y",