From 244cec869d12e53378fa0efb610cd4c32a454ec8 Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Mon, 11 Aug 2025 05:09:33 -0700 Subject: [PATCH] Update the document in typed tests to use using-declaration instead of typedef PiperOrigin-RevId: 793600153 Change-Id: I0c78f180f3b681ef20133af2cc822af66c3344fe --- googletest/include/gtest/gtest-typed-test.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/googletest/include/gtest/gtest-typed-test.h b/googletest/include/gtest/gtest-typed-test.h index 442e00bd3..ae24f9491 100644 --- a/googletest/include/gtest/gtest-typed-test.h +++ b/googletest/include/gtest/gtest-typed-test.h @@ -48,15 +48,15 @@ template class FooTest : public testing::Test { public: ... - typedef std::list List; + using List = ::std::list; static T shared_; T value_; }; // Next, associate a list of types with the test suite, which will be -// repeated for each type in the list. The typedef is necessary for +// repeated for each type in the list. The using-declaration is necessary for // the macro to parse correctly. -typedef testing::Types MyTypes; +using MyTypes = ::testing::Types; TYPED_TEST_SUITE(FooTest, MyTypes); // If the type list contains only one type, you can write that type @@ -157,7 +157,7 @@ REGISTER_TYPED_TEST_SUITE_P(FooTest, // argument to the INSTANTIATE_* macro is a prefix that will be added // to the actual test suite name. Remember to pick unique prefixes for // different instances. -typedef testing::Types MyTypes; +using MyTypes = ::testing::Types; INSTANTIATE_TYPED_TEST_SUITE_P(My, FooTest, MyTypes); // If the type list contains only one type, you can write that type