<div dir="auto"><div dir="auto">I have been trying to learn about the AST using python bindings of libclang. But I have not been able to enumerate the fields of a struct successfully. I don't know if I'm doing it wrong, or if it's a bug.</div><div dir="auto"><br></div><div dir="auto">Here is the code I wrote: <a href="https://gist.github.com/jeet-parekh/936b932b4f2501debd0c40172f6af128">https://gist.github.com/jeet-parekh/936b932b4f2501debd0c40172f6af128</a></div><div dir="auto"><br></div><div dir="auto">It simply prints the displayname, spelling, and number of fields of a struct.</div><div dir="auto"><br></div><div dir="auto">And I am running it on the imgui.h file from the <a href="https://github.com/ocornut/imgui">https://github.com/ocornut/imgui</a> project.</div><div dir="auto"><br></div><div dir="auto">For a lot of the structs, I get "fields count: 0". I wrote an equivalent program in C++. And I got the same result. How do I fix it?</div><div dir="auto"><br></div><div dir="auto">I have cloned the clang repo from the provided git mirror. The latest commit in my clone is:</div><div dir="auto">git commit id: 3b778bc3cec73f904457d70d6f956e1aafe1b550</div><div dir="auto">git-svn-id: <a href="https://llvm.org/svn/llvm-project/cfe/trunk@345691">https://llvm.org/svn/llvm-project/cfe/trunk@345691</a> 91177308-0d34-0410-b5e6-96231b3b80d8</div><div dir="auto"><br></div><div dir="auto">Thanks!</div><div dir="auto"><br></div></div>