Hi All

I ran into a case where thrift generated code that would not compile

For the following data definition:
*struct lstMember {
  1: required i16                data1,
}
struct someStruct {
  1: required list<lstMember>   lst = [{'data1':1}]
}
*

With the following generation
*thrift -r -o generated --gen "cpp:pure_enums" t1.thrift*

I get the following compilation errors:
*g++  -MD -I/usr/local/include/thrift -Igenerated/gen-cpp -c
generated/gen-cpp/t1_types.cpp*
*generated/gen-cpp/t1_types.h: In constructor ‘someStruct::someStruct()’:
generated/gen-cpp/t1_types.h:59: error: ‘class lstMember’ has no member
named ‘__isset’
*


Observation:
The generated struct seems to have no 'isset' (internal) for required
members (totally expected)
yet the generated constructor attempts to set the isset (internal) member

Workaround:
If its not critical, make the data members 'optional' to force generation of
the isset members

Questions:

   1. Anything wrong in my thrift file?
   2. Should this email e considered a bug report or do I need to enter
   something in JIRA?


Possibly related
https://issues.apache.org/jira/browse/THRIFT-72
https://issues.apache.org/jira/browse/THRIFT-627

Thanks
  -Nevo

Reply via email to