You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As expected both classes appear in the desc file. However, for the toto class the members are not wrapped at all.
# The class toto c=class_(
py_type="Toto", # name of the python class c_type="toto<double>", # name of the C++ class doc="""Instantiate""", # doc of the C++ class hdf5=False,
)
module.add_class(c)
# The class totoro c=class_(
py_type="Totoro", # name of the python class c_type="totoro", # name of the C++ class doc="""Normal""", # doc of the C++ class hdf5=False,
)
c.add_member(c_name="i",
c_type="double",
read_only=False,
doc="""""")
module.add_class(c)
I had a brief look at the AST I got from the clang.cindex by iterating recursively over the children of all the nodes and found
CursorKind.TRANSLATION_UNIT
CursorKind.CLASS_TEMPLATE
CursorKind.TEMPLATE_TYPE_PARAMETER
CursorKind.CXX_ACCESS_SPEC_DECL
CursorKind.FIELD_DECL
CursorKind.TYPE_REF
CursorKind.CLASS_DECL # Instantiation of template class toto
CursorKind.CLASS_DECL # Non-template class totoro
CursorKind.CXX_ACCESS_SPEC_DECL
CursorKind.FIELD_DECL
i.e. the instantiation has no children in the cindex AST. I suppose this is the reason why no members are added by cpp2py?
The strange thing is that the AST using clang -cc1 -ast-dump looks different and does indeed specify all the information necessary
Ok, we discussed, we found that there is a fix in lib clang.
Was it a fix in the cindex.py only ?
At some point, we might want to include cindex.py in our code, also to make python 2 and 3 transition easier and not depends on packaging systems to have this file or not ...
I tried to wrap to following minimal example to test the wrapping of an instantiated template class
As expected both classes appear in the desc file. However, for the
toto
class the members are not wrapped at all.I had a brief look at the AST I got from the clang.cindex by iterating recursively over the children of all the nodes and found
i.e. the instantiation has no children in the cindex AST. I suppose this is the reason why no members are added by cpp2py?
The strange thing is that the AST using
clang -cc1 -ast-dump
looks different and does indeed specify all the information necessaryThe text was updated successfully, but these errors were encountered: