Fix changing struct name bug on C++ generation
Reviewed By: aditya
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664925 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/compiler/cpp/src/generate/t_cpp_generator.cc b/compiler/cpp/src/generate/t_cpp_generator.cc
index 44b339d..b6de861 100644
--- a/compiler/cpp/src/generate/t_cpp_generator.cc
+++ b/compiler/cpp/src/generate/t_cpp_generator.cc
@@ -727,11 +727,13 @@
vector<t_function*>::iterator f_iter;
for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
t_struct* ts = (*f_iter)->get_arglist();
+ string name_orig = ts->get_name();
ts->set_name(tservice->get_name() + "_" + (*f_iter)->get_name() + "_args");
generate_struct_definition(f_service_, ts);
generate_struct_reader(f_service_, ts);
generate_struct_writer(f_service_, ts);
generate_function_helpers(tservice, *f_iter);
+ ts->set_name(name_orig);
}
}