aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/compiler/cpp/cpp_string_field.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/google/protobuf/compiler/cpp/cpp_string_field.cc')
-rw-r--r--src/google/protobuf/compiler/cpp/cpp_string_field.cc9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/google/protobuf/compiler/cpp/cpp_string_field.cc b/src/google/protobuf/compiler/cpp/cpp_string_field.cc
index 2874de7d..359e5e26 100644
--- a/src/google/protobuf/compiler/cpp/cpp_string_field.cc
+++ b/src/google/protobuf/compiler/cpp/cpp_string_field.cc
@@ -762,7 +762,7 @@ void StringOneofFieldGenerator::
GenerateConstructorCode(io::Printer* printer) const {
printer->Print(
variables_,
- "$classname$_default_oneof_instance_.$name$_.UnsafeSetDefault(\n"
+ "_$classname$_default_instance_.$name$_.UnsafeSetDefault(\n"
" $default_variable$);\n");
}
@@ -838,9 +838,7 @@ GenerateAccessorDeclarations(io::Printer* printer) const {
"$deprecated_attr$void add_$name$(const ::std::string& value);\n"
"$deprecated_attr$void add_$name$(const char* value);\n"
"$deprecated_attr$void add_$name$(const $pointer_type$* value, size_t size)"
- ";\n");
-
- printer->Print(variables_,
+ ";\n"
"$deprecated_attr$const ::google::protobuf::RepeatedPtrField< ::std::string>& $name$() "
"const;\n"
"$deprecated_attr$::google::protobuf::RepeatedPtrField< ::std::string>* mutable_$name$()"
@@ -898,8 +896,7 @@ GenerateInlineAccessorDefinitions(io::Printer* printer,
"$classname$::add_$name$(const $pointer_type$* value, size_t size) {\n"
" $name$_.Add()->assign(reinterpret_cast<const char*>(value), size);\n"
" // @@protoc_insertion_point(field_add_pointer:$full_name$)\n"
- "}\n");
- printer->Print(variables,
+ "}\n"
"$inline$const ::google::protobuf::RepeatedPtrField< ::std::string>&\n"
"$classname$::$name$() const {\n"
" // @@protoc_insertion_point(field_list:$full_name$)\n"