From abc38690dc77abd43710e30e9d659fb9abca8543 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Wed, 9 Feb 2022 06:32:41 -0800 Subject: [PATCH] Manually applying two clang-format changes that need fix-ups for clang-tidy. (#3705) --- include/pybind11/pytypes.h | 4 ++-- tests/test_stl.cpp | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/include/pybind11/pytypes.h b/include/pybind11/pytypes.h index 339f0fff5..d39e71045 100644 --- a/include/pybind11/pytypes.h +++ b/include/pybind11/pytypes.h @@ -1516,8 +1516,8 @@ public: } } - // NOLINTNEXTLINE(google-explicit-constructor) - template operator T *() const { + template + operator T *() const { // NOLINT(google-explicit-constructor) return get_pointer(); } diff --git a/tests/test_stl.cpp b/tests/test_stl.cpp index bc5c6553a..77fc9b99b 100644 --- a/tests/test_stl.cpp +++ b/tests/test_stl.cpp @@ -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"));