Hello, I am hitting a problem in pygccxml regarding anonymous enums used as class member variables.
Something like this:
When I scan this, pygccxml tells me the attribute 'type' of 'SomeObject' is of type 'SomeObject'. I happily try to generate code for this, and of course the generated code does not even compile:
[14/25] cxx: build/default/tests/foomodule2.cc -> build/default/tests/foomodule2_9.o
default/tests/foomodule2.cc: In function 'int _wrap_PySomeObject__set_type(PySomeObject*, PyObject*)':
default/tests/foomodule2.cc:6211: error: cannot convert 'SomeObject' to 'SomeObject::<anonymous enum>' in assignment
It would be better if pygccxml reported the type as "SomeObject::<anonymous enum>", like GCC does. This way at least I will not be lead me to generate invalid code (I prefer no code at all than erroneous code).
This with pygccxml 0.9.5, gccxml 2008-04-20.
My work around for the moment is:
real_type = type_traits.remove_declarated(member.type)
if hasattr(real_type, 'name') and not real_type.name
print >> sys.stderr, ">>>>>>>>>>>>>> skip anonymous type"
Gustavo J. A. M. Carneiro
INESC Porto, Telecommunications and Multimedia Unit
"The universe is always one step beyond logic." -- Frank Herbert