[cfe-dev] libclang and std::vector and other collections

Jaime Long serimral22 at hotmail.com
Thu Apr 3 08:12:12 PDT 2014


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<int> vi;       // <------------------------------------ BAD  Bar<int> bi;           // Fine}
Will be handled fine apart from the vi definition.  VisitChildren doesn't ever visit this.
Any advice much appreciated,Puzzled Newbie. 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140403/11419010/attachment.html>


More information about the cfe-dev mailing list