diff --git a/include/pybind11/detail/smart_holder_type_casters.h b/include/pybind11/detail/smart_holder_type_casters.h index 15ab81c58d..653332bf83 100644 --- a/include/pybind11/detail/smart_holder_type_casters.h +++ b/include/pybind11/detail/smart_holder_type_casters.h @@ -79,7 +79,7 @@ class modified_type_caster_generic_load_impl { } // type_caster_generic::load_value END } - loaded_v_h = std::move(v_h); + loaded_v_h = v_h; loaded_v_h.type = typeinfo; } diff --git a/include/pybind11/trampoline_self_life_support.h b/include/pybind11/trampoline_self_life_support.h index 115f094ba7..cdb1fb3ed3 100644 --- a/include/pybind11/trampoline_self_life_support.h +++ b/include/pybind11/trampoline_self_life_support.h @@ -53,7 +53,7 @@ struct trampoline_self_life_support { // For the next two, the default implementations generate undefined behavior (ASAN failures // manually verified). The reason is that v_h needs to be kept default-initialized. trampoline_self_life_support(const trampoline_self_life_support &) {} - trampoline_self_life_support(trampoline_self_life_support &&) {} + trampoline_self_life_support(trampoline_self_life_support &&) noexcept {} // These should never be needed (please provide test cases if you think they are). trampoline_self_life_support &operator=(const trampoline_self_life_support &) = delete;