Initialize `match` variable in `MatchAndExplain`'s loop of gmock-matchers.h

This prevents the warning of `variable 'match' is not initialized [cppcoreguidelines-init-variables]`.
This commit is contained in:
John Law 2026-06-21 17:09:29 +01:00 committed by GitHub
parent 0b1e895ba4
commit 4ae2709798
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -3696,7 +3696,7 @@ class [[nodiscard]] ElementsAreMatcherImpl
// the end of either the elements or the matchers, or until we find a
// mismatch.
for (; it != stl_container.end() && exam_pos != count(); ++it, ++exam_pos) {
bool match; // Does the current element match the current matcher?
bool match = false; // Does the current element match the current matcher?
if (listener_interested) {
StringMatchResultListener s;
match = matchers_[exam_pos].MatchAndExplain(*it, &s);