diff --git a/src/google/protobuf/parse_context.h b/src/google/protobuf/parse_context.h index 661008589d..11eae7106f 100644 --- a/src/google/protobuf/parse_context.h +++ b/src/google/protobuf/parse_context.h @@ -428,7 +428,7 @@ class PROTOBUF_EXPORT ParseContext : public EpsCopyInputStream { template bool ExpectTag(const char* ptr) { if (tag < 128) { - return *ptr == tag; + return *ptr == static_cast(tag); } else { static_assert(tag < 128 * 128, "We only expect tags for 1 or 2 bytes"); char buf[2] = {static_cast(tag | 0x80), static_cast(tag >> 7)};