From cbd9a98301da0d12db2d920340775e0aed97bf01 Mon Sep 17 00:00:00 2001 From: Sandy Zhang Date: Thu, 18 Jan 2024 13:35:56 -0800 Subject: [PATCH] Don't emit redundant enum name gencode when has_reflection is false. This is already emitted a few lines before in previous has_reflection_ condition and results in compiler -Wredundant-decls warnings. Fixes #14979 PiperOrigin-RevId: 599610424 --- src/google/protobuf/compiler/cpp/enum.cc | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/google/protobuf/compiler/cpp/enum.cc b/src/google/protobuf/compiler/cpp/enum.cc index e23d6e0d64..1041a957d7 100644 --- a/src/google/protobuf/compiler/cpp/enum.cc +++ b/src/google/protobuf/compiler/cpp/enum.cc @@ -221,10 +221,6 @@ void EnumGenerator::GenerateDefinition(io::Printer* p) { static_cast(value)); } )cc"); - } else { - p->Emit(R"cc( - const std::string& $Msg_Enum$_Name($Msg_Enum$ value); - )cc"); } } else { p->Emit({{"static_assert", write_assert}}, R"cc(