Incorrect endLoc of MemberExpr in AST?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Incorrect endLoc of MemberExpr in AST?

David Zarzycki via cfe-dev
My question is described on SO:

I got no answer on SO, and I suppose that I can reach more clang devs through this mailing list. I hope it is ok.

Thanks!

Best,
Nikita

_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Incorrect endLoc of MemberExpr in AST?

David Zarzycki via cfe-dev
On Mon, Jan 13, 2020 at 8:31 AM Nikita Petrenko via cfe-dev
<[hidden email]> wrote:
>
> My question is described on SO:
> https://stackoverflow.com/questions/59697541/expression-size-in-ast-is-incorrect-for-member-access
>
> I got no answer on SO, and I suppose that I can reach more clang devs through this mailing list. I hope it is ok.
>
> Thanks!

SourceLocations in Clang point to the insertion point before the
token, not to the insertion point after the token. To find the end of
the characters, you have to measure the token length and add it to the
end location. You can use Lexer::getLocForEndOfToken() to do this
automatically for you.

HTH!

~Aaron

>
> Best,
> Nikita
> _______________________________________________
> cfe-dev mailing list
> [hidden email]
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev