mirror of
https://github.com/pybind/pybind11.git
synced 2026-05-12 17:26:13 +00:00
clang-tidy fixes (mostly manual) related to PR #3166
This commit is contained in:
@@ -309,7 +309,7 @@ struct smart_holder {
|
||||
hld.vptr.reset(static_cast<void *>(unq_ptr.get()), std::move(gd));
|
||||
else
|
||||
hld.vptr.reset(unq_ptr.get(), std::move(gd));
|
||||
unq_ptr.release();
|
||||
(void) unq_ptr.release();
|
||||
hld.is_populated = true;
|
||||
return hld;
|
||||
}
|
||||
|
||||
@@ -704,13 +704,11 @@ struct smart_holder_type_caster<std::shared_ptr<T>> : smart_holder_type_caster_l
|
||||
static handle cast(const std::shared_ptr<T> &src, return_value_policy policy, handle parent) {
|
||||
switch (policy) {
|
||||
case return_value_policy::automatic:
|
||||
break;
|
||||
case return_value_policy::automatic_reference:
|
||||
break;
|
||||
case return_value_policy::take_ownership:
|
||||
throw cast_error("Invalid return_value_policy for shared_ptr (take_ownership).");
|
||||
case return_value_policy::copy:
|
||||
break;
|
||||
case return_value_policy::move:
|
||||
break;
|
||||
case return_value_policy::reference:
|
||||
@@ -809,7 +807,7 @@ struct smart_holder_type_caster<std::unique_ptr<T, D>> : smart_holder_type_caste
|
||||
// Critical transfer-of-ownership section. This must stay together.
|
||||
self_life_support->deactivate_life_support();
|
||||
holder.reclaim_disowned();
|
||||
src.release();
|
||||
(void) src.release();
|
||||
// Critical section end.
|
||||
return existing_inst;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user