libclang and std::vector and other collections

Hi All,

I’m a complete clang newbie, so apologies in advance…

I’m using libclang via clang-sharp in a c# tool which will parse my c++ code and automatically generate code for reflection/serialisation etc. And all is good until I start to look at std::vector members or other collection classes.

I’m calling VisitChildren in a manner similar to the simplified code below:

cursor.VisitChildren((child, parent) => {if(child.Kind == CursorKind.FieldDecl) {/Do Stuff/}; return Cursor.ChildVisitResult.Continue;});

And an an example the following:

class Test
{
int i;
char* s;
std::string str;
Test* p;
bool b;
Foo& foo;
vector vi; // <------------------------------------ BAD
Bar bi; // Fine
}

Will be handled fine apart from the vi definition. VisitChildren doesn’t ever visit this.

Any advice much appreciated,
Puzzled Newbie.