<html>
<head></head>
<body>
<p>Hi,</p>
<p>My question is simple. Could anyone explain me what's the difference between the methods<br/>
getResultType and getCallResultType in FunctionDecl?</p>
<p>This is the implementation in FunctionType:</p>
<pre class="fragment"><a class="code" href="http://clang.llvm.org/doxygen/classclang_1_1FunctionType.html#aafa453cd7e81a7c3d6c61f261e68afe8">02783</a>   <a class="code" href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a> <a class="code" href="http://clang.llvm.org/doxygen/classclang_1_1FunctionType.html#aafa453cd7e81a7c3d6c61f261e68afe8">getResultType</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> ResultType; }<br />...<br /><a class="code" href="http://clang.llvm.org/doxygen/classclang_1_1FunctionType.html#a5f8df0258bcf7281e7055ea01dbd8f85">02799</a>   <a class="code" href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a> <a class="code" title="Determine the type of an expression that calls a function of this type." href="http://clang.llvm.org/doxygen/classclang_1_1FunctionType.html#a5f8df0258bcf7281e7055ea01dbd8f85">getCallResultType</a>(<a class="code" title="Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ..." href="http://clang.llvm.org/doxygen/classclang_1_1ASTContext.html">ASTContext</a> &<a class="code" href="http://clang.llvm.org/doxygen/ASTMatchFinder_8cpp.html#a779280869b9fac47a9bc391e7709171f">Context</a>)<span class="keyword"> const </span>{2800     <span class="keywordflow">return</span> getResultType().<a class="code" title="Determine the type of a (typically non-lvalue) expression with the specified result type..." href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html#a89e3ea65c009b7a0ea76edc56076107c">getNonLValueExprType</a>(Context);2801   }</pre><p>And this is the definition of<a class="code" title="Determine the type of a (typically non-lvalue) expression with the specified result type..." href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html#a89e3ea65c009b7a0ea76edc56076107c"> getNonLValueExprType</a>:<br/>
<span style="font-size: 10pt;">Determine the type of a (typically non-lvalue) expression with the specified result type. </span><br/>
<span style="font-size: 10pt;">This routine should be used for expressions for which the return type is explicitly specified (e.g., in a cast or call) and isn't necessarily an lvalue. It removes a top-level reference (since there are no expressions of reference type) and deletes top-level cvr-qualifiers from non-class types (in C++) or all types (in C). </span></p>
<p>But I am not able to understand this very well. Could anyone give me an example of the difference? Up to now, I have been using getResultType, but now I have found getCallResultType and I'm not sure what should I use.</p>
<p>Thanks in advance,</p>
<p>Pedro.</p>
<br/>
<br/>
</body>
</html>