Remove C++17 feature that's incompatible with C++14 support

PiperOrigin-RevId: 501989602
pull/13171/head
Mike Kruskal 2 years ago committed by Copybara-Service
parent 06b5775fd7
commit a77cec4f4f
  1. 13
      upbc/protoc-gen-upb.cc

@ -1291,16 +1291,19 @@ void WriteMessageField(upb::FieldDefPtr field,
}
std::string GetSub(upb::FieldDefPtr field) {
if (auto message_def = field.message_type(); message_def) {
if (auto message_def = field.message_type()) {
return absl::Substitute("{.submsg = &$0}", MessageInitName(message_def));
} else if (auto enum_def = field.enum_subdef();
enum_def && enum_def.is_closed()) {
}
if (auto enum_def = field.enum_subdef()) {
if (enum_def.is_closed()) {
return absl::Substitute("{.subenum = &$0}", EnumInit(enum_def));
} else {
return std::string("{.submsg = NULL}");
}
}
return std::string("{.submsg = NULL}");
}
// Writes a single message into a .upb.c source file.
void WriteMessage(upb::MessageDefPtr message, const DefPoolPair& pools,
const Options& options, Output& output) {

Loading…
Cancel
Save