From 91c99b6ffecb6f37ca11c25a0db84007c263c1f2 Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Tue, 18 Aug 2026 07:43:53 -0700 Subject: [PATCH] Add missing `const` in INSTANTIATE_TEST_SUITE_P. Dropping this causes tools like [misc-const-correctness](http://clang.llvm.org/extra/clang-tidy/checks/misc/const-correctness.html) to flag GTEST macro invocations as non-const-correct. PiperOrigin-RevId: 966588433 Change-Id: I896acca9e079288e971a2912c7aa6d17ec6a15e4 --- googletest/include/gtest/gtest-param-test.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/googletest/include/gtest/gtest-param-test.h b/googletest/include/gtest/gtest-param-test.h index 9e023f96..64c60da8 100644 --- a/googletest/include/gtest/gtest-param-test.h +++ b/googletest/include/gtest/gtest-param-test.h @@ -552,7 +552,7 @@ auto ConvertGenerator(Gen&& gen, Func&& f) { #define INSTANTIATE_TEST_SUITE_P(prefix, test_suite_name, ...) \ static ::testing::internal::ParamGenerator \ - gtest_##prefix##test_suite_name##_EvalGenerator_() { \ + gtest_##prefix##test_suite_name##_EvalGenerator_() { \ return GTEST_EXPAND_(GTEST_GET_FIRST_(__VA_ARGS__, DUMMY_PARAM_)); \ } \ static ::std::string gtest_##prefix##test_suite_name##_EvalGenerateName_( \ @@ -562,7 +562,7 @@ auto ConvertGenerator(Gen&& gen, Func&& f) { __VA_ARGS__, \ ::testing::internal::DefaultParamName, \ DUMMY_PARAM_))); \ - auto t = std::make_tuple(__VA_ARGS__); \ + const auto t = std::make_tuple(__VA_ARGS__); \ static_assert(std::tuple_size::value <= 2, \ "Too Many Args!"); \ } \