From 5cfe9ce97c83588bec4c6724f71b8a58bb37c678 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sun, 30 Mar 2025 11:14:01 +0800 Subject: [PATCH] neorados/test: use [[maybe_unused]] instead of GTEST_ATTRIBUTE_UNUSED_ This change: - Aligns with GoogleTest's own evolution, which now uses `[[maybe_unused]]` internally (via `GTEST_INTERNAL_ATTRIBUTE_MAYBE_UNUSED`) as of https://github.com/google/googletest/commit/5a37b517 - Leverages C++20 features already available in Ceph - Removes dependency on GoogleTest internal macros - Enables updating the GoogleTest submodule to silence CMake warnings Using the standard C++ attribute provides better compatibility and future-proofing than relying on GoogleTest's internal implementation details. This change also allows us to bump up googletest submodule to silence a CMake warning. Signed-off-by: Kefu Chai --- src/test/neorados/common_tests.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/neorados/common_tests.h b/src/test/neorados/common_tests.h index 0aec479ac68..81d0ecc57c1 100644 --- a/src/test/neorados/common_tests.h +++ b/src/test/neorados/common_tests.h @@ -404,7 +404,7 @@ private: \ private: \ boost::asio::awaitable CoTestBody() override; \ - static ::testing::TestInfo *const test_info_ GTEST_ATTRIBUTE_UNUSED_; \ + [[maybe_unused]] static ::testing::TestInfo *const test_info_; \ }; \ \ ::testing::TestInfo *const GTEST_TEST_CLASS_NAME_(test_suite_name, \ -- 2.47.3