summaryrefslogtreecommitdiff
path: root/compiler/cpp/src/thrift/generate/t_cpp_generator.cc
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/cpp/src/thrift/generate/t_cpp_generator.cc')
-rw-r--r--compiler/cpp/src/thrift/generate/t_cpp_generator.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/cpp/src/thrift/generate/t_cpp_generator.cc b/compiler/cpp/src/thrift/generate/t_cpp_generator.cc
index 0420e62e7..dd444bc9c 100644
--- a/compiler/cpp/src/thrift/generate/t_cpp_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_cpp_generator.cc
@@ -4398,9 +4398,9 @@ string t_cpp_generator::namespace_close(string ns) {
string t_cpp_generator::type_name(t_type* ttype, bool in_typedef, bool arg) {
if (ttype->is_base_type()) {
string bname = base_type_name(((t_base_type*)ttype)->get_base());
- std::map<string, string>::iterator it = ttype->annotations_.find("cpp.type");
- if (it != ttype->annotations_.end()) {
- bname = it->second;
+ std::map<string, std::vector<string>>::iterator it = ttype->annotations_.find("cpp.type");
+ if (it != ttype->annotations_.end() && !it->second.empty()) {
+ bname = it->second.back();
}
if (!arg) {