Skip to content

Commit cab4955

Browse files
committed
Apply a couple more fixes
1 parent 4bdd6fc commit cab4955

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/test_stl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ class ReferenceSensitiveOptional {
164164
namespace pybind11 { namespace detail {
165165
template <typename T>
166166
struct type_caster<ReferenceSensitiveOptional<T>> : optional_caster<ReferenceSensitiveOptional<T>> {};
167-
} // namespace pybind11::detail
167+
} // namespace detail
168168
} // namespace pybind11
169169

170170

@@ -399,7 +399,7 @@ TEST_SUBMODULE(stl, m) {
399399
return (x ? x.value() : 0) * 2;
400400
});
401401
m.def("half_or_none_refsensitive", [](int x) -> refsensitive_opt_int {
402-
return x ? refsensitive_opt_int(x / 2) : refsensitive_opt_int();
402+
return x != 0 ? refsensitive_opt_int(x / 2) : refsensitive_opt_int();
403403
});
404404
// NOLINTNEXTLINE(performance-unnecessary-value-param)
405405
m.def("test_nullopt_refsensitive", [](refsensitive_opt_int x) {

0 commit comments

Comments
 (0)