mirror of
https://github.com/pybind/pybind11.git
synced 2026-06-08 15:29:45 +00:00
Propagate py::multiple_inheritance to all children (#3650)
* Add tests demonstrating smart_holder issues with multiple inheritance * Propagate C++ multiple inheritance markers to all children - Makes py::multiple_inheritance only needed in base classes hidden from pybind11
This commit is contained in:
@@ -1206,10 +1206,13 @@ protected:
|
||||
if (rec.bases.size() > 1 || rec.multiple_inheritance) {
|
||||
mark_parents_nonsimple(tinfo->type);
|
||||
tinfo->simple_ancestors = false;
|
||||
tinfo->simple_type = false;
|
||||
}
|
||||
else if (rec.bases.size() == 1) {
|
||||
auto parent_tinfo = get_type_info((PyTypeObject *) rec.bases[0].ptr());
|
||||
tinfo->simple_ancestors = parent_tinfo->simple_ancestors;
|
||||
// a child of a non-simple type can never be a simple type
|
||||
tinfo->simple_type = parent_tinfo->simple_type;
|
||||
}
|
||||
|
||||
if (rec.module_local) {
|
||||
|
||||
Reference in New Issue
Block a user