[libclang] Avoid having the cursor of an expression replace the declaration cursor
commit064c44b8a17d4c426b87ad1c58de81d76a13fca3
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Mon, 27 Jun 2011 19:42:23 +0000 (27 19:42 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Mon, 27 Jun 2011 19:42:23 +0000 (27 19:42 +0000)
tree9222a9f1b0d955d0a98b5f2be24529f6e4f465f8
parent5517b89953e3c9276f161ce29831de388bb2573d
[libclang] Avoid having the cursor of an expression replace the declaration cursor
when the expression source range overlaps the declaration range.

This can happen for C++ constructor expressions whose range generally
include the variable declaration, e.g.:

  MyCXXClass foo; // Make sure pointing at 'foo' returns a VarDecl cursor.

rdar://9124499.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133930 91177308-0d34-0410-b5e6-96231b3b80d8
test/Index/get-cursor.cpp
tools/libclang/CIndex.cpp