<div style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial"><div>Hi,<br><br>I'm trying to use clang's ParseAST() and ASTConsumer to extract all c function declarations in a source file, and then output these function declarations into another file. <br>It's all good unless there is some unknown type name exists. For example,<br>  my_type foo(int x) { /*...*/ }    // "my_type" is just a type identifier whose definition is missed in this translation unit.<br>When I use getReturnType() in RecursiveASTVisitor::VisitFunctionDecl(), it will return type "int". So my program will output<br>  int foo(int x);<br>instead of<br>  my_type foo(int x);<br>I'm curious why "my_type" will be parsed as of type "int". <br>When parsing this source code, clang will report an error saying "error: unknown type name 'my_type'". So I think clang knows it's a type (unknown type is also a type I think).<br><br>Thanks!<br></div></div><br><br><span title="neteasefooter"><span id="netease_mail_footer"></span></span>