Of course, that makes sense. The top-most type will always be the same as the return type. (Bangs head on desk !).<br /><br />Looking through the implicit cast does then allow me to check for 'undesirable' type conversions.<br /><br />Thanks, I knew it would be easy ;-)<div> </div>Phil.<br /><br>  <div style="font-family: Courier New, courier, monaco, monospace, sans-serif; font-size: 12pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div  dir="ltr" > <font size="2" face="Arial"> <hr size="1">  <b><span style="font-weight:bold;">From:</span></b> John McCall <rjmccall@apple.com><br> <b><span style="font-weight: bold;">To:</span></b> Phil King <phil_king@rocketmail.com> <br><b><span style="font-weight: bold;">Cc:</span></b> Clang dev mailing list <cfe-dev@cs.uiuc.edu> <br> <b><span style="font-weight: bold;">Sent:</span></b> Friday, 23 March 2012, 18:09<br> <b><span
 style="font-weight: bold;">Subject:</span></b> Re: [cfe-dev] Function return type from ReturnStmt<br> </font> </div> <br><meta http-equiv="x-dns-prefetch-control" content="off"><div id=yiv305436411><html><head></head><div><div><div>On Mar 23, 2012, at 1:49 AM, Phil King wrote:</div><blockquote type="cite"><div><div style="color:rgb(0, 0, 0);background-color:rgb(255, 255, 255);font-family:courier, monaco, monospace, sans-serif;font-size:12pt;"><div><span>I'm trying to get the return type for the function associated with a ReturnStmt AST node.</span></div><div><br><span></span></div><div><span>The type of the return expression is easy as that's available via getRetValue(), but I can't see an obvious way to get the return type of the function (so I can check the two match).</span></div></div></div></blockquote><div><br></div>The expression in the ReturnStmt will have been implicitly converted to the return type, so unless you're writing an
 AST verifier, there is nothing to do here.</div><div><br></div><div>You probably want to look past any implicit conversions and see what expression was actually written.</div><div><br></div><div>John.</div></div></html></div><meta http-equiv="x-dns-prefetch-control" content="on"><br><br> </div> </div>