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
pull/15487/head
Sandy Zhang 11 months ago committed by Copybara-Service
parent fc2d9da9c0
commit cbd9a98301
  1. 4
      src/google/protobuf/compiler/cpp/enum.cc

@ -221,10 +221,6 @@ void EnumGenerator::GenerateDefinition(io::Printer* p) {
static_cast<int>(value)); static_cast<int>(value));
} }
)cc"); )cc");
} else {
p->Emit(R"cc(
const std::string& $Msg_Enum$_Name($Msg_Enum$ value);
)cc");
} }
} else { } else {
p->Emit({{"static_assert", write_assert}}, R"cc( p->Emit({{"static_assert", write_assert}}, R"cc(

Loading…
Cancel
Save