From ea55f1f52c489535f0d3b583c81529762c9cb5ea Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Mon, 14 Feb 2022 13:27:54 -0800 Subject: [PATCH] Address conversion warning by explicitly casting to size_t Closes #3762 PiperOrigin-RevId: 428593750 Change-Id: Ifac216568fbc7d999adb71996ec6a1bbe3b97412 --- googletest/src/gtest.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/googletest/src/gtest.cc b/googletest/src/gtest.cc index 4775fbc3..396fdfe2 100644 --- a/googletest/src/gtest.cc +++ b/googletest/src/gtest.cc @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -745,7 +746,8 @@ class UnitTestFilter { const auto exact_match_patterns_begin = std::partition( all_patterns.begin(), all_patterns.end(), &IsGlobPattern); - glob_patterns_.reserve(exact_match_patterns_begin - all_patterns.begin()); + glob_patterns_.reserve(static_cast( + std::distance(all_patterns.begin(), exact_match_patterns_begin))); std::move(all_patterns.begin(), exact_match_patterns_begin, std::inserter(glob_patterns_, glob_patterns_.begin())); std::move(