clang can't parse my .h file standalone
问题 I'm using python binding of libclang but I think this problem is caused by libclang not by python binding. I have a header object.h #ifndef OBJECT_H #define OBJECT_H class Object { public: int run(); }; #endif And a implementation object.cpp #include "object.h" int Object::run() { int a = 0; return a*a; } If I visit AST of the translation unit of object.h , the last AST node is VAR_DECL class Object and that's it. It won't visit public:... part. If I use clang to check syntax directly is