Skip to content

Commit

Permalink
Manually applying two clang-format changes that need fix-ups for clan…
Browse files Browse the repository at this point in the history
…g-tidy. (pybind#3705)
  • Loading branch information
Ralf W. Grosse-Kunstleve authored Feb 9, 2022
1 parent 7769e77 commit abc3869
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions include/pybind11/pytypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -1516,8 +1516,8 @@ class capsule : public object {
}
}

// NOLINTNEXTLINE(google-explicit-constructor)
template <typename T> operator T *() const {
template <typename T>
operator T *() const { // NOLINT(google-explicit-constructor)
return get_pointer<T>();
}

Expand Down
9 changes: 5 additions & 4 deletions tests/test_stl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -400,10 +400,11 @@ TEST_SUBMODULE(stl, m) {
m.def("half_or_none_refsensitive", [](int x) -> refsensitive_opt_int {
return x != 0 ? refsensitive_opt_int(x / 2) : refsensitive_opt_int();
});
// NOLINTNEXTLINE(performance-unnecessary-value-param)
m.def("test_nullopt_refsensitive", [](refsensitive_opt_int x) {
return x ? x.value() : 42;
}, py::arg_v("x", refsensitive_opt_int(), "None"));
m.def(
"test_nullopt_refsensitive",
// NOLINTNEXTLINE(performance-unnecessary-value-param)
[](refsensitive_opt_int x) { return x ? x.value() : 42; },
py::arg_v("x", refsensitive_opt_int(), "None"));
m.def("test_no_assign_refsensitive", [](const refsensitive_opt_no_assign &x) {
return x ? x->value : 42;
}, py::arg_v("x", refsensitive_opt_no_assign(), "None"));
Expand Down

0 comments on commit abc3869

Please sign in to comment.