Our project is using clang python api to generate python bindings for C++ classes. Right now we have a limitation that the copy will only be exposed if a type has an explicitly defined copy constructor.
I would like to change it to also declare a copy for a generated copy constructor - so I need to detect that somehow.
All the structs I care about are trivially copyable, so if I can only detect trivially copyable ones that is fine as well.
How could I tell that a struct I am at is copyable or trivially copyable?
I have CursorKind.STRUCT_DECL
as my starting point.
This is what we ended up with.
a) Seems like from clang ast directly you can only ask if 'is_pod' cindex.py
Not quite what I need since
pod
also implies no default constructor accroding to this std::is_pod std::is_trivial.b) What we did is:
enum <ClassName>_Traits
withstd::is_copy_constructible
for a class of interest.