[PATCH] D40481: [libclang] Fix cursors for arguments of Subscript and Call operators

Nikolai Kosjar via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 27 02:41:24 PST 2017


nik created this revision.

The DeclRefExpr of CXXOperatorCallExpr refering to the custom operator
is visited before the arguments to the operator call. For the Call and
Subscript operator the range of this DeclRefExpr includes the whole call
expression, so that all tokens in that range were mapped to the operator
function, even the tokens of the arguments.

Fix this by ensuring that this particular DeclRefExpr is visited last.

Fixes PR25775.


https://reviews.llvm.org/D40481

Files:
  test/Index/annotate-operator-call-expr.cpp
  tools/libclang/CIndex.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40481.124339.patch
Type: text/x-patch
Size: 13208 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20171127/dbe71817/attachment-0001.bin>


More information about the cfe-commits mailing list