diff --git a/src/google/protobuf/repeated_field.h b/src/google/protobuf/repeated_field.h index 432236ce45..61f3f55845 100644 --- a/src/google/protobuf/repeated_field.h +++ b/src/google/protobuf/repeated_field.h @@ -692,7 +692,7 @@ class LIBPROTOBUF_EXPORT StringTypeHandlerBase { class StringTypeHandler : public StringTypeHandlerBase { public: static int SpaceUsed(const string& value) { - return sizeof(value) + StringSpaceUsedExcludingSelf(value); + return static_cast(sizeof(value)) + StringSpaceUsedExcludingSelf(value); } };