diff --git a/cpp/src/phonenumbers/phonenumberutil.cc b/cpp/src/phonenumbers/phonenumberutil.cc index e1fda9c8b..29a1609fa 100644 --- a/cpp/src/phonenumbers/phonenumberutil.cc +++ b/cpp/src/phonenumbers/phonenumberutil.cc @@ -298,7 +298,7 @@ void GetSupportedTypesForMetadata( const PhoneMetadata& metadata, std::set* types) { DCHECK(types); - for (int i = 0; i < static_cast(PhoneNumberUtil::kMaxNumberType); ++i) { + for (int i = 0; i <= static_cast(PhoneNumberUtil::kMaxNumberType); ++i) { PhoneNumberUtil::PhoneNumberType type = static_cast(i); if (type == PhoneNumberUtil::FIXED_LINE_OR_MOBILE ||