Thanks for your reply. But i still can not figure it out. I get function declaration by these codes below:<br><br>class MyASTVisitor : public RecursiveASTVisitor<MyASTVisitor> <br>{<br>public:<br>    bool VisitFunctionDecl(FunctionDecl *f) {<br>        for (FunctionDecl::param_iterator it = f->param_begin(); it != f->param_end(); ++it) {<br>            ParmVarDecl *p = *it; <br>            ...<br>        }        <br>        return true;<br>    }    <br>};<br><br>which means I only get `FunctionDecl` object. I do not know how to get a `FunctionTypeInfo` you mentioned. Maybe I 'm not on the right way to parse a function definition/declaration. <br><br>BTW, I'm writing a static code analyzer tool, and i will check whether a function parameter has a type declarator.<br><br><br><div><div><br></div><div style="font-size: 12px;font-family: Arial Narrow;padding:2px 0 2px 0;">------------------ 原始邮件 ------------------</div><div style="font-size: 12px;background:#efefef;padding:8px;"><div><b>发件人:</b> "Nikola Smiljanic"<popizdeh@gmail.com>;</div><div><b>发送时间:</b> 2013年1月1日(星期二) 晚上7:56</div><div><b>收件人:</b> "kevinlynx"<kevinlynx@gmail.com>; <wbr></div><div><b>抄送:</b> "cfe-dev"<cfe-dev@cs.uiuc.edu>; <wbr></div><div><b>主题:</b> Re: [cfe-dev] how to determine a parameter has a type declarator in clang</div></div><div><br></div>Have a look at ArgInfo member of FunctionTypeInfo, the comment for ParamInfo structure has the relevant part:<div><br></div><div><div>/// ParamInfo - An array of paraminfo objects is allocated whenever a function</div><div>

/// declarator is parsed.  There are two interesting styles of arguments here:</div><div>/// K&R-style identifier lists and parameter type lists.  K&R-style identifier</div><div>/// lists will have information about the identifier,<b> but no type information.</b></div>

<div>/// Parameter type lists will have type info (if the actions module provides</div><div>/// it), but may have null identifier info: e.g. for 'void foo(int X, int)'.</div><div><br><div class="gmail_quote">On Mon, Dec 31, 2012 at 6:40 PM, kevinlynx <span dir="ltr"><<a href="mailto:kevinlynx@gmail.com" target="_blank">kevinlynx@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><br>I use clang to do some code analyse. And now i have a function below<br><br>    void func(p)<br>

<br>some compilers will process p as an integer. And i want to know how to determine whether p has a type declarator ?<br><br></div></div><br>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div></div></div>