From: Kefu Chai Date: Sun, 30 Mar 2025 03:14:01 +0000 (+0800) Subject: neorados/test: use [[maybe_unused]] instead of GTEST_ATTRIBUTE_UNUSED_ X-Git-Tag: v20.3.0~214^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5cfe9ce97c83588bec4c6724f71b8a58bb37c678;p=ceph.git 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 --- diff --git a/src/test/neorados/common_tests.h b/src/test/neorados/common_tests.h index 0aec479ac682..81d0ecc57c14 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, \