Skip to content

Commit 9059bd8

Browse files
author
Wenzel Jakob
committed
added test for issue #70
1 parent 2bc946b commit 9059bd8

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

example/issues.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@ PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr<T>);
1515
void init_issues(py::module &m) {
1616
py::module m2 = m.def_submodule("issues");
1717

18+
#if !defined(_MSC_VER)
19+
// Visual Studio 2015 currently cannot compile this test
20+
// (see the comment in type_caster_base::make_copy_constructor)
21+
// #70 compilation issue if operator new is not public
22+
class NonConstructible { private: void *operator new(size_t bytes) throw(); };
23+
py::class_<NonConstructible>(m, "Foo");
24+
m.def("getstmt", []() -> NonConstructible * { return nullptr; },
25+
py::return_value_policy::reference);
26+
#endif
27+
1828
// #137: const char* isn't handled properly
1929
m2.def("print_cchar", [](const char *string) { std::cout << string << std::endl; });
2030

0 commit comments

Comments
 (0)