mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-26 15:12:01 +00:00
added test for issue #70
This commit is contained in:
parent
2bc946bd7a
commit
9059bd8134
@ -15,6 +15,16 @@ PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr<T>);
|
|||||||
void init_issues(py::module &m) {
|
void init_issues(py::module &m) {
|
||||||
py::module m2 = m.def_submodule("issues");
|
py::module m2 = m.def_submodule("issues");
|
||||||
|
|
||||||
|
#if !defined(_MSC_VER)
|
||||||
|
// Visual Studio 2015 currently cannot compile this test
|
||||||
|
// (see the comment in type_caster_base::make_copy_constructor)
|
||||||
|
// #70 compilation issue if operator new is not public
|
||||||
|
class NonConstructible { private: void *operator new(size_t bytes) throw(); };
|
||||||
|
py::class_<NonConstructible>(m, "Foo");
|
||||||
|
m.def("getstmt", []() -> NonConstructible * { return nullptr; },
|
||||||
|
py::return_value_policy::reference);
|
||||||
|
#endif
|
||||||
|
|
||||||
// #137: const char* isn't handled properly
|
// #137: const char* isn't handled properly
|
||||||
m2.def("print_cchar", [](const char *string) { std::cout << string << std::endl; });
|
m2.def("print_cchar", [](const char *string) { std::cout << string << std::endl; });
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user