Skip to content

Commit 8acf6d7

Browse files
committed
CI fixes
1 parent aafb878 commit 8acf6d7

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

include/pybind11/detail/type_caster_base.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1708,7 +1708,7 @@ class type_caster_base : public type_caster_generic {
17081708
srcs, return_value_policy::take_ownership, {}, nullptr, nullptr, holder);
17091709
if (srcs.used_foreign) {
17101710
// Foreign cast succeeded; release C++ ownership
1711-
(void) holder->release();
1711+
(void) holder->release(); // NOLINT(bugprone-unused-return-value)
17121712
}
17131713
return ret;
17141714
}
@@ -1724,7 +1724,7 @@ class type_caster_base : public type_caster_generic {
17241724
ret.dec_ref();
17251725
throw error_already_set();
17261726
}
1727-
(void) sp.release();
1727+
(void) sp.release(); // NOLINT(bugprone-unused-return-value)
17281728
}
17291729

17301730
template <class T>

include/pybind11/pybind11.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,11 @@ inline std::string generate_function_signature(const char *type_caster_name_fiel
158158
if (!t) {
159159
pybind11_fail("Internal error while parsing type signature (1)");
160160
}
161-
if (handle th = detail::get_type_handle(*t, false, true)) {
162-
signature += th.attr("__module__").cast<std::string>() + "."
163-
+ th.attr("__qualname__").cast<std::string>();
164-
} else if ((th = detail::global_internals_native_enum_type_map_get_item(*t))) {
161+
handle th = detail::get_type_handle(*t, false, true);
162+
if (!th) {
163+
th = detail::global_internals_native_enum_type_map_get_item(*t);
164+
}
165+
if (th) {
165166
signature += th.attr("__module__").cast<std::string>() + "."
166167
+ th.attr("__qualname__").cast<std::string>();
167168
} else if (func_rec->is_new_style_constructor && arg_index == 0) {

tests/test_potentially_slicing_weak_ptr.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ namespace potentially_slicing_weak_ptr {
1111

1212
template <int> // Using int as a trick to easily generate multiple types.
1313
struct VirtBase {
14+
VirtBase() = default;
1415
virtual ~VirtBase() = default;
1516
VirtBase(const VirtBase &) = delete;
1617
virtual int get_code() { return 100; }

0 commit comments

Comments
 (0)