mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-25 14:45:12 +00:00
Add back original copyable_holder_caster
check_holder_compat()
in the std::shared_ptr
specialization and remove pytest.skip("BAKEIN_EXPECTED: ...)
in test_smart_ptr.py
This commit is contained in:
parent
cc2a428142
commit
6fb8b5157d
@ -919,6 +919,11 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
friend class type_caster_generic;
|
friend class type_caster_generic;
|
||||||
|
void check_holder_compat() {
|
||||||
|
if (typeinfo->default_holder) {
|
||||||
|
throw cast_error("Unable to load a custom holder type from a default-holder instance");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void load_value(value_and_holder &&v_h) {
|
void load_value(value_and_holder &&v_h) {
|
||||||
if (typeinfo->holder_enum_v == detail::holder_enum_t::smart_holder) {
|
if (typeinfo->holder_enum_v == detail::holder_enum_t::smart_holder) {
|
||||||
|
@ -298,7 +298,6 @@ def test_move_only_holder_with_addressof_operator():
|
|||||||
|
|
||||||
|
|
||||||
def test_smart_ptr_from_default():
|
def test_smart_ptr_from_default():
|
||||||
pytest.skip("BAKEIN_EXPECTED: Failed: DID NOT RAISE <class 'RuntimeError'>")
|
|
||||||
instance = m.HeldByDefaultHolder()
|
instance = m.HeldByDefaultHolder()
|
||||||
with pytest.raises(RuntimeError) as excinfo:
|
with pytest.raises(RuntimeError) as excinfo:
|
||||||
m.HeldByDefaultHolder.load_shared_ptr(instance)
|
m.HeldByDefaultHolder.load_shared_ptr(instance)
|
||||||
|
Loading…
Reference in New Issue
Block a user