From 42759b4bf5d9cf9a13346df289bf4ea58b04ff4b Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Fri, 20 Nov 2026 15:16:12 -0500 Subject: [PATCH] fix(tests): avoid MSVC 14.52 unreachable-code warning in test_buffers Assisted-by: ClaudeCode:claude-opus-5-5 --- tests/test_buffers.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/test_buffers.cpp b/tests/test_buffers.cpp index 0a43f37c48..3a089cb8b0 100644 --- a/tests/test_buffers.cpp +++ b/tests/test_buffers.cpp @@ -289,13 +289,11 @@ TEST_SUBMODULE(buffers, m) { class BrokenMatrix : public Matrix { public: BrokenMatrix(py::ssize_t rows, py::ssize_t cols) : Matrix(rows, cols) {} - void throw_runtime_error() { throw std::runtime_error("See PR #5324 for context."); } }; py::class_(m, "BrokenMatrix", py::buffer_protocol()) .def(py::init()) - .def_buffer([](BrokenMatrix &m) { - m.throw_runtime_error(); - return py::buffer_info(); + .def_buffer([](BrokenMatrix &) -> py::buffer_info { + throw std::runtime_error("See PR #5324 for context."); }); // test_inherited_protocol