[cfe-dev] Expr::getSourceRange() doesn't return full range

Ted Kremenek kremenek at apple.com
Wed Mar 17 13:30:16 PDT 2010


This is expected.  The source range gives you the locations of the first and last token.  To get the full range, you need to re-lex the last token.  Check out HighlightRanges in TextDiagnosticPrinter for an example.

On Mar 17, 2010, at 11:46 AM, Stephen Deken wrote:

> There is a trailing space.  Obviously, SourceRange::getEnd() is
> returning the beginning of the last token in the range.





More information about the cfe-dev mailing list