Ralf W. Grosse-Kunstleve
621b9230e4
Copying files as-is from branch test_unique_ptr_member (PR #2672 ).
2021-01-29 14:18:21 -08:00
Ralf W. Grosse-Kunstleve
c4aeb3ca26
Removing test_type_caster_bare_interface, which was moved to the separate PR #2834 .
2021-01-29 14:15:24 -08:00
Ralf W. Grosse-Kunstleve
af8c311321
Giving up on idea to use legacy init_instance only if is_base_of<type_caster_generic, type_caster<T>. There are use cases in the wild that define both a custom type_caster and class_.
2021-01-29 14:11:57 -08:00
Ralf W. Grosse-Kunstleve
19021b6e1c
Adding classu alias for class_<U, std::unique_ptr<U>>.
2021-01-29 14:11:57 -08:00
Ralf W. Grosse-Kunstleve
78a9882e84
Fixing oversight.
2021-01-29 14:11:57 -08:00
Ralf W. Grosse-Kunstleve
bb6390f1a4
Replacing detail::is_smart_holder<H> in cast.h with detail::is_smart_holder_type_caster<T>.
...
Moving get_local_load_function_ptr, init_instance_for_type to smart_holder_type_caster_class_hooks.
Expanding static_assert in py::type::handle_of<> to accommodate smart_holder_type_casters.
2021-01-29 14:11:57 -08:00
Ralf W. Grosse-Kunstleve
b00caae8ff
Reintroducing py::classh, this time as a simple alias for py::class_<U, py::smart_holder>.
2021-01-29 14:11:57 -08:00
Ralf W. Grosse-Kunstleve
e19d373d98
Moving define PYBIND11_SMART_HOLDER_TYPE_CASTERS(T) down in the file. NO functional changes. Preparation for follow-up work (to keep that diff smaller).
2021-01-29 14:11:57 -08:00
Ralf W. Grosse-Kunstleve
d44de0e519
Making use of the new find_existing_python_instance() function factored out with PR #2822 .
2021-01-29 14:11:57 -08:00
Ralf W. Grosse-Kunstleve
40d49a5bf8
Adding tests/pure_cpp/CMakeLists.txt.
2021-01-29 14:11:57 -08:00
Ralf W. Grosse-Kunstleve
0b266681b5
Adding new header files to tests/extra_python_package/test_files.py.
2021-01-29 14:11:57 -08:00
Ralf W. Grosse-Kunstleve
7355e946f2
Explicitly define copy/move constructors/assignments.
2021-01-29 14:11:57 -08:00
Ralf W. Grosse-Kunstleve
51f3b9ce42
Adding copyright notices to new header files.
2021-01-29 14:11:57 -08:00
Ralf W. Grosse-Kunstleve
d8a5f1143f
CMake COMPARE NATURAL is not available with older versions.
2021-01-29 14:11:57 -08:00
Ralf W. Grosse-Kunstleve
66114cdce1
Reusing type_caster_base make_copy_constructor, make_move_constructor with a trick.
2021-01-29 14:11:57 -08:00
Ralf W. Grosse-Kunstleve
1b3d68c59c
32-bit compatibility.
2021-01-29 14:11:57 -08:00
Ralf W. Grosse-Kunstleve
acbea0c4eb
clang-tidy fixes.
2021-01-29 14:11:57 -08:00
Ralf W. Grosse-Kunstleve
6fbcee952a
Changing CMake file so that test_class_sh_module_local.py actually runs.
2021-01-29 14:11:57 -08:00
Ralf W. Grosse-Kunstleve
e6857d2623
Adding new tests to CMake config, resetting CI config.
2021-01-29 14:11:57 -08:00
Ralf W. Grosse-Kunstleve
21c6a67894
Renaming new tests/core subdirectory to tests/pure_cpp.
2021-01-29 14:11:56 -08:00
Ralf W. Grosse-Kunstleve
817c174a43
Renaming test_type_caster_bare_interface_demo to test_type_caster_bare_interface.
2021-01-29 14:11:56 -08:00
Ralf W. Grosse-Kunstleve
69f684671d
Systematically renaming tests to use "class_sh" in the name.
2021-01-29 14:11:56 -08:00
Ralf W. Grosse-Kunstleve
6b9f544df4
Renaming all "classh" to "smart_holder" in pybind11/detail/smart_holder_type_casters.h.
...
The user-facing macro is now PYBIND11_SMART_HOLDER_TYPE_CASTERS.
2021-01-29 14:11:56 -08:00
Ralf W. Grosse-Kunstleve
7f67db974a
Renaming files in include directory, creating pybind11/smart_holder.h.
2021-01-29 14:11:56 -08:00
Ralf W. Grosse-Kunstleve
ab7d11f2d9
Adding py::smart_holder support to py::class_, purging py::classh completely.
2021-01-29 14:11:56 -08:00
Ralf W. Grosse-Kunstleve
eb5678665f
Moving several tests to github.com/rwgk/rwgk_tbx/tree/main/pybind11_tests
...
a2c2f88174
These tests are from experimenting, and for demonstrating UB in pybind11 multiple inheritance handling ("first_base"), to be fixed later.
2021-01-29 14:11:56 -08:00
Ralf W. Grosse-Kunstleve
0dffc292a4
Purging obsolete pybind11/vptr_holder.h and associated test.
2021-01-29 14:11:56 -08:00
Ralf W. Grosse-Kunstleve
6f7b10fe9f
Removing debugging comments (GET_STACK, GET_INT_STACK). cast.h is identical to current master again, pybind11.h only has the generic_type::initialize(..., &type_caster_generic::local_load) change.
2021-01-29 14:11:56 -08:00
Ralf W. Grosse-Kunstleve
d2807d895c
Converting test_unique_ptr_member to using classh: fully working, ASAN, MSAN, UBSAN clean.
2021-01-29 14:11:56 -08:00
Ralf W. Grosse-Kunstleve
2351d4b424
Using unique_ptr in local_load to replace static variable. Also adding local_load_safety_guard.
2021-01-29 14:11:56 -08:00
Ralf W. Grosse-Kunstleve
c322f981ab
Folding convert_type into lvalue_ref and rvalue_ref paths. Some smart_holder_type_caster_load cleanup.
2021-01-29 14:11:56 -08:00
Ralf W. Grosse-Kunstleve
89da41b4c0
Factoring out convert_type and folding into loaded_as_unique_ptr.
2021-01-29 14:11:56 -08:00
Ralf W. Grosse-Kunstleve
048ebc8a85
Cleaning up loaded_as_raw_ptr_unowned, loaded_as_shared_ptr.
2021-01-29 14:11:56 -08:00
Ralf W. Grosse-Kunstleve
01eb1904a5
Removing rtti_held from smart_holder. See updated comment.
2021-01-29 14:11:56 -08:00
Ralf W. Grosse-Kunstleve
494331a67b
Adding smart_holder_type_caster_load::loaded_as_shared_ptr, currently bypassing smart_holder shared_ptr tracking completely, but the tests pass and are sanitizer clean.
2021-01-29 14:11:56 -08:00
Ralf W. Grosse-Kunstleve
3b6a20c398
Moving const after type name, for functions that cover a systematic scheme. NO functional changes.
2021-01-29 14:11:56 -08:00
Ralf W. Grosse-Kunstleve
effda3e31a
Adopting systematic naming scheme from test_classh_wip. NO functional changes.
2021-01-29 14:11:56 -08:00
Ralf W. Grosse-Kunstleve
1d8c27d101
Pure renaming of function and variable names, for better generalization when convoluting with inheritance. NO functional changes.
2021-01-29 14:11:56 -08:00
Ralf W. Grosse-Kunstleve
25b254574f
Pure renaming of function names in test_classh_inheritance, similar to the systematic approach used in test_class_wip. NO functional changes.
2021-01-29 14:11:56 -08:00
Ralf W. Grosse-Kunstleve
d5f92c7d25
Tests for classh py::module_local() feature.
2021-01-29 14:11:56 -08:00
Ralf W. Grosse-Kunstleve
e1c8a98b1b
Removing stray isinstance<T>(src): it interferes with the py::module_local feature. Adding missing #includes.
2021-01-29 14:11:56 -08:00
Ralf W. Grosse-Kunstleve
543a04ff18
Minimal test covering classh_type_casters load_impl Case 2b.
2021-01-29 14:11:56 -08:00
Ralf W. Grosse-Kunstleve
98162ff356
Changes and tests covering classh_type_casters try_implicit_casts.
2021-01-29 14:11:56 -08:00
Ralf W. Grosse-Kunstleve
ecd22fa103
Decoupling generic_type from type_caster_generic.
2021-01-29 14:11:55 -08:00
Ralf W. Grosse-Kunstleve
7a841082f2
First pass adjusting try_implicit_casts and try_load_foreign_module_local to capture loaded_v_h, but untested and guarded with pybind11_failure("Untested"). This was done mainly to determine general feasibility. Note the TODO in pybind11.h, where type_caster_generic::local_load is currently hard-coded. test_classh_wip and test_classh_inheritance still pass, as before.
2021-01-29 14:11:55 -08:00
Ralf W. Grosse-Kunstleve
f0c2d10d35
Minimal changes needed to pass test_classh_inheritance.
2021-01-29 14:11:55 -08:00
Ralf W. Grosse-Kunstleve
f2329d8cca
Folding in modified_type_caster_generic_load_impl, just enough to pass test_class_wip. test_classh_inheritance is still failing, but with a different error: [RuntimeError: Incompatible type (as_raw_ptr_unowned).]
2021-01-29 14:11:55 -08:00
Ralf W. Grosse-Kunstleve
463788af26
Bringing back .clang-format, the previous rm was a bad idea.
2021-01-29 14:11:55 -08:00
Ralf W. Grosse-Kunstleve
f066e43052
Removing .clang-format before git rebase master (where the file was added).
2021-01-29 14:11:55 -08:00
Ralf W. Grosse-Kunstleve
c29134cdf9
Adding test_classh_inheritance, currently failing (passes with class_).
2021-01-29 14:11:55 -08:00