Skip to content

Commit

Permalink
With the following code:
Browse files Browse the repository at this point in the history
              Foo f = Foo();
For this location:    ^

We will first get a CallExpr on Foo(), then we get a TypeRef on the Foo struct/class
We don't want the typeref except when passing -e
  • Loading branch information
Andersbakken committed Oct 14, 2014
1 parent 1ff77bb commit 45ec3c1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/CursorInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,14 @@ SymbolMap CursorInfo::callers(const Location &loc, const SymbolMap &map) const
{
SymbolMap ret;
const SymbolMap cursors = virtuals(loc, map);
const bool isClazz = isClass();
for (auto c = cursors.begin(); c != cursors.end(); ++c) {
for (auto it = c->second->references.begin(); it != c->second->references.end(); ++it) {
const auto found = RTags::findCursorInfo(map, *it);
if (found == map.end())
continue;
if (isClazz && found->second->kind == CXCursor_CallExpr)
continue;
if (RTags::isReference(found->second->kind)) { // is this always right?
ret[*it] = found->second;
} else if (kind == CXCursor_Constructor && (found->second->kind == CXCursor_VarDecl || found->second->kind == CXCursor_FieldDecl)) {
Expand Down

0 comments on commit 45ec3c1

Please sign in to comment.