From a2118f6587e09ac822798394a5f9736eba002555 Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Sat, 15 Aug 2026 18:34:19 -0700 Subject: [PATCH] Use std::make_unique to avoid clang-tidy false positive in GTEST_TEST_ macro. PiperOrigin-RevId: 965352463 Change-Id: I4062f4f7a48cba6bf514abd7860d422f6e98cee7 --- googletest/include/gtest/internal/gtest-internal.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/googletest/include/gtest/internal/gtest-internal.h b/googletest/include/gtest/internal/gtest-internal.h index 55e99667..a630cc82 100644 --- a/googletest/include/gtest/internal/gtest-internal.h +++ b/googletest/include/gtest/internal/gtest-internal.h @@ -1516,8 +1516,9 @@ class [[nodiscard]] NeverThrown { parent_class>::GetSetUpCaseOrSuite(__FILE__, __LINE__), \ ::testing::internal::SuiteApiResolver< \ parent_class>::GetTearDownCaseOrSuite(__FILE__, __LINE__), \ - new ::testing::internal::TestFactoryImpl); \ + ::std::make_unique<::testing::internal::TestFactoryImpl< \ + GTEST_TEST_CLASS_NAME_(test_suite_name, test_name)>>() \ + .release()); \ void GTEST_TEST_CLASS_NAME_(test_suite_name, test_name)::TestBody() #endif // GOOGLETEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_