Skip to content

Commit

Permalink
Fix -Wunused-parameter in map<string, int> fields (fixes #8494) (#8500)
Browse files Browse the repository at this point in the history
* Fix -Wunused-parameter in map<string, int> fields

* Fix tabs
  • Loading branch information
georgthegreat committed Apr 16, 2021
1 parent 8babb3b commit 0f25590
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/google/protobuf/compiler/cpp/cpp_map_field.cc
Expand Up @@ -229,7 +229,10 @@ void MapFieldGenerator::GenerateSerializeWithCachedSizesToArray(
if (utf8_check) {
format(
"struct Utf8Check {\n"
" static void Check(ConstPtr p) {\n");
" static void Check(ConstPtr p) {\n"
// p may be unused when GetUtf8CheckMode evaluates to kNone,
// thus disabling the validation.
" (void)p;\n");
format.Indent();
format.Indent();
if (string_key) {
Expand Down

0 comments on commit 0f25590

Please sign in to comment.