<div dir="ltr">Do you mean "is referenced" (in other words, is used) or "is a reference" (in other words "may modify the original value in the caller function")?<br></div><div class="gmail_extra"><br><div class="gmail_quote">On 22 May 2017 at 08:21, Big~Newbie via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>I want to judge whether a function take reference parameters. the sample code as "void m(int& a){}", the <b>a</b> is referenced! </div><div>I use the following code to access this, but it can't, whats wrong with me?</div><blockquote style="margin:0.8em 0px 0.8em 2em;padding:0px 0px 0px 0.7em;border-left:2px solid rgb(221,221,221)">   <i>FunctionDecl *funDecl = callExpr->getDirectCallee();<br></i><i>   ParmVarDecl* decl = funDecl->getParamDecl(i);//i=0<br></i><i>   if(decl->getType()-><wbr>isReferenceType()) {// I use this to judge parameter a is referenced, but cannt!!!<br></i><i>           myfile<<"---Ref type:"<<argNames[i]<<endl;<br></i><i>    }</i></blockquote><div><i></i></div><br>______________________________<wbr>_________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div>