<div dir="ltr">Hi Stephan,<div><br></div><div>It's a common problem, there's a helper in Clang Tooling library that solves this.</div><div>Take a look at the getExtendedRange function from "include/clang/Tooling/Transformer/SourceCode.h".</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Oct 29, 2019 at 10:48 AM Stephan Bergmann via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Because of how Expr is derived from Stmt, e.getSourceRange() for an Expr <br>
e that constitutes an expression-statement doesn't include the closing ";".<br>
<br>
Is there perhaps some code already somewhere that provides the extended <br>
SourceRange?  (I'd imagined that SourceManager might provide something <br>
like that, but couldn't find anything.)<br>
<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Regards,</div><div>Ilya Biryukov</div></div></div></div></div>