From 9059bd813405917e16a8f0543dd64fa258ca7bfa Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Sun, 1 May 2016 10:39:45 +0200 Subject: [PATCH] added test for issue #70 --- example/issues.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/example/issues.cpp b/example/issues.cpp index 5c8c369f..bb773fae 100644 --- a/example/issues.cpp +++ b/example/issues.cpp @@ -15,6 +15,16 @@ PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr); void init_issues(py::module &m) { 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_(m, "Foo"); + m.def("getstmt", []() -> NonConstructible * { return nullptr; }, + py::return_value_policy::reference); +#endif + // #137: const char* isn't handled properly m2.def("print_cchar", [](const char *string) { std::cout << string << std::endl; });