Resolve complex typedefs in Thrift
authorMark Slee <mcslee@apache.org>
Tue, 16 Jan 2007 23:53:53 +0000 (23:53 +0000)
committerMark Slee <mcslee@apache.org>
Tue, 16 Jan 2007 23:53:53 +0000 (23:53 +0000)
Summary: For function returns

Reviewed By: aditya

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664917 13f79535-47bb-0310-9956-ffa450edef68

compiler/cpp/src/generate/t_cpp_generator.h

index 260c8d6..5a1cbf6 100644 (file)
@@ -135,6 +135,10 @@ class t_cpp_generator : public t_oop_generator {
   std::string type_to_enum(t_type* ttype);
 
   bool is_complex_type(t_type* ttype) {
+    while (ttype->is_typedef()) {
+      ttype = ((t_typedef*)ttype)->get_type();
+    }
+
     return
       ttype->is_container() || 
       ttype->is_struct() ||