diff --git a/include/flatbuffers/util.h b/include/flatbuffers/util.h
index e6540105a501721e8543ba5da879437a5e1c178e..7cadd0b5f965ab27d15183a388f423e10552e232 100644
--- a/include/flatbuffers/util.h
+++ b/include/flatbuffers/util.h
@@ -321,7 +321,7 @@ inline int FromUTF8(const char **in) {
       break;
     }
   }
-  if ((static_cast<const unsigned char>(**in) << len) & 0x80) return -1;  // Bit after leading 1's must be 0.
+  if ((static_cast<unsigned char>(**in) << len) & 0x80) return -1;  // Bit after leading 1's must be 0.
   if (!len) return *(*in)++;
   // UTF-8 encoded values with a length are between 2 and 4 bytes.
   if (len < 2 || len > 4) { return -1; }