From 98370f2d1a5097f86b8731d8334b9e1a1108a15d Mon Sep 17 00:00:00 2001 From: Xuehai Pan Date: Mon, 22 Dec 2025 16:37:59 +0800 Subject: [PATCH] Suppress unused variable warning --- .../mod_per_interpreter_gil_with_singleton.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_multiple_interpreters/mod_per_interpreter_gil_with_singleton.cpp b/tests/test_multiple_interpreters/mod_per_interpreter_gil_with_singleton.cpp index 5ee5b050e..874b93c77 100644 --- a/tests/test_multiple_interpreters/mod_per_interpreter_gil_with_singleton.cpp +++ b/tests/test_multiple_interpreters/mod_per_interpreter_gil_with_singleton.cpp @@ -51,6 +51,7 @@ public: static void init() { // Ensure the singleton is created auto &instance = get_instance(); + (void) instance; // suppress unused variable warning assert(instance.objects.size() == 7); // Register cleanup at interpreter exit py::module_::import("atexit").attr("register")(py::cpp_function(&MySingleton::clear)); @@ -58,6 +59,7 @@ public: static void clear() { auto &instance = get_instance(); + (void) instance; // suppress unused variable warning assert(instance.objects.size() == 7); for (const auto &obj : instance.objects) { obj.dec_ref();